Class PluginDescriptorImpl

java.lang.Object
org.processmining.framework.plugin.impl.AbstractPluginDescriptor
org.processmining.framework.plugin.impl.PluginDescriptorImpl
All Implemented Interfaces:
Comparable<PluginDescriptor>, PluginDescriptor

public class PluginDescriptorImpl extends AbstractPluginDescriptor
  • Method Details

    • getPackage

      public PackageDescriptor getPackage()
      Description copied from interface: PluginDescriptor
      Return the package where the plug-in resides.
      Returns:
    • getMostSignificantResult

      public int getMostSignificantResult()
      Description copied from interface: PluginDescriptor
      Returns the index in the result array of the most significant result for this plugin
      Returns:
      the index in the result array of the most significant result. If no results are returned by this plugin, anything can be returned.
    • hasAnnotation

      public boolean hasAnnotation(Class<? extends Annotation> annotationClass)
      Description copied from interface: PluginDescriptor
      Check if this plugin carries the given annotation. Implementing classes can return false at their discretion, i.e. they are not required to return true for all annotations carried by the plugin.
      Returns:
    • getAnnotation

      public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
      Description copied from interface: PluginDescriptor
      Return the annotation of the given class carried by this plugin. Note that hasAnnotationClass(annotationClass) is assumed. This method should not be used to access any annotation elements carried by Plugin.class. Implementing classes are allows to return null when called with Plugin.class.
      Returns:
    • getName

      public String getName()
      Description copied from interface: PluginDescriptor
      Return the name of the plugin. This name is not unique within ProM.
      Returns:
    • hashCode

      public int hashCode()
      Description copied from interface: PluginDescriptor
      return hashcode
      Specified by:
      hashCode in interface PluginDescriptor
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Description copied from interface: PluginDescriptor
      return equality of plugins. The ID is used for equality.
      Specified by:
      equals in interface PluginDescriptor
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Description copied from interface: PluginDescriptor
      Returns a String representation of the plugin
      Specified by:
      toString in interface PluginDescriptor
      Overrides:
      toString in class Object
    • execute

      protected Object[] execute(PluginContext context, int methodIndex, Object... allArgs) throws Exception
      Description copied from class: AbstractPluginDescriptor
      In this method, the pluginDescriptor should do the actual work of concstructing the result. Note that no objects passed in the allArgs argument are futures anymore.
      Specified by:
      execute in class AbstractPluginDescriptor
      Returns:
      Throws:
      Exception
    • findMethod

      protected Method findMethod(Object[] allArgs)
    • getReturnTypes

      public List<Class<? extends Object>> getReturnTypes()
      returns the labels of the objects returned if this plugin is invoked, in the order in which they are returned
      Returns:
    • getParameterTypes

      public List<Class<?>> getParameterTypes(int methodIndex)
      Description copied from interface: PluginDescriptor
      Returns a list of types that represent the required parameters of the method at the given index. In other words, the method at index methodIndex requires exectly the parameter types as provided in the returned list, in that order.
      Returns:
    • getPluginParameterType

      public Class<?> getPluginParameterType(int methodIndex, int parameterIndex)
      Description copied from interface: PluginDescriptor
      Return the type of the parameter at index parameterIndex of the method at methodIndex.
      Parameters:
      methodIndex - 0 <= methodIndex < getNumberOfMethods()
      parameterIndex - 0 <= parameterIndex < getParameterTypes().size()
      Returns:
      may return null if the parameter is not used by the given method
    • getParameterTypes

      public List<List<Class<?>>> getParameterTypes()
      Description copied from interface: PluginDescriptor
      returns a list of size getNumberOfMethods(), such that element at index i of the list equals getParameterTypes(i)
      Returns:
    • getParameterNames

      public List<String> getParameterNames()
      Description copied from interface: PluginDescriptor
      Returns a list of labels that represent the possible parameters of this plugin. Each method required a subset of these labels, while preserving their order.
      Returns:
    • getTypesAtParameterIndex

      public Set<Class<?>> getTypesAtParameterIndex(int index)
      Description copied from interface: PluginDescriptor
      Returns a list of types that can be accepted for the parameter at index globalParameterIndex. The parameter index is global, i.e. not method specific. Instead, for each type t in the set returned by this method it is guaranteed that there is at least one method (suppose at index i), such that getParameterType(i, getIndexInMethod(i, globalParameterIndex)) == t
      Parameters:
      index - 0 <= globalParameterIndex < getParameterNames().size()
      Returns:
    • getNumberOfMethods

      public int getNumberOfMethods()
      Return the number of methods in this plugin.
      Returns:
    • getParameterNames

      public List<String> getParameterNames(int methodIndex)
      Description copied from interface: PluginDescriptor
      Returns a list of labels that represent the required parameters of the method at the given index. In other words, the method at index methodIndex requires exactly the parameter labels as provided in the returned list, in that order.
      Returns:
    • getPluginParameterName

      public String getPluginParameterName(int methodIndex, int parameterIndex)
      Description copied from interface: PluginDescriptor
      Return the label of the parameter at index parameterIndex of the method at methodIndex.
      Parameters:
      methodIndex - 0 <= methodIndex < getNumberOfMethods()
      parameterIndex - 0 <= parameterIndex < getParameterTypes(methodIndex).size()
      Returns:
      may return null if the parameter is not used by the given method
    • getReturnNames

      public List<String> getReturnNames()
      returns the types of the objects returned if this plugin is invoked, in the order in which they are returned
      Returns:
    • getID

      public PluginDescriptorID getID()
      Description copied from interface: PluginDescriptor
      returns the ID of this Plugin. Provided that the code of a plugin does not change, these IDs are persistent between executions of ProM.
      Returns:
    • getContextType

      public Class<? extends PluginContext> getContextType(int methodIndex)
      Description copied from interface: PluginDescriptor
      Returns the context type required by the method at index methodIndex.
      Parameters:
      methodIndex - 0 <= methodIndex < getNumberOfMethods()
      Returns:
    • compareTo

      public int compareTo(PluginDescriptor plugin)
      Description copied from interface: PluginDescriptor
      Compares this plugin with another plugins. Uses the getName().toLowerCase() for comparing. Only if names are equal, then the IDs are used for comparison. Comparison should be name-based between different implementing classes.
    • getIndexInParameterNames

      public int getIndexInParameterNames(int methodIndex, int methodParameterIndex)
      Description copied from interface: PluginDescriptor
      Returns the index of the method parameter of the given method in the list of global parameters. Each method of a plugin requires a subset of the global set of parameters that the plugin defines. This method can be used to map the index of each method parameter to the index of the global parameter.
      Parameters:
      methodIndex - 0 <= methodIndex < getNumberOfMethods()
      methodParameterIndex - 0 <= methodParameterIndex < getParameterNames(methodIndex).size()
      Returns:
      0 <= return < getParameterNames().size()
    • getIndexInMethod

      public int getIndexInMethod(int methodIndex, int parameterIndex)
      Description copied from interface: PluginDescriptor
      Returns the index of the global parameter to the index of that parameter in the given method. Each method of a plugin requires a subset of the global set of parameters that the plugin defines. This method can be used to map the index of each global parameter to the index of the method parameter. Note that if the given method does not require the global parameter, -1 is returned.
      Parameters:
      methodIndex - 0 <= methodIndex < getNumberOfMethods()
      parameterIndex - 0 <= globalParameterIndex < getParameterNames().size()
      Returns:
      -1 <= return < getParameterNames(methodIndex).size()
    • getMethodLabel

      public String getMethodLabel(int methodIndex)
      Description copied from interface: PluginDescriptor
      Return the label of the given method, if specified. If no label was specified, the name of the plugin is returned.
      Returns:
    • isUserAccessible

      public boolean isUserAccessible()
      Description copied from interface: PluginDescriptor
      Returns true if this plugin can be used by the end-users. If this is set to false, such a plugin should not be presented to the end user by any context.
      Returns:
    • handlesCancel

      public boolean handlesCancel()
      Description copied from interface: PluginDescriptor
      Returns whether the plugin handles termination itself.
      Returns:
    • getAnnotation

      public <T extends Annotation> T getAnnotation(Class<T> annotationClass, int methodIndex)
      Description copied from interface: PluginDescriptor
      Return the annotation of the method at the given index. Note that hasAnnotationClass(annotationClass, methodIndex) is assumed. This method should not be used to access any annotation elements carried by Plugin.class. Implementing classes are allows to return null when called with Plugin.class.
      Returns:
    • hasAnnotation

      public boolean hasAnnotation(Class<? extends Annotation> annotationClass, int methodIndex)
      Description copied from interface: PluginDescriptor
      Check if the method at the given index carries the given annotation. Implementing classes can return false at their discretion, i.e. they are not required to return true for all annotations carried by the plugin.
      Returns:
    • getHelp

      public String getHelp()
      Description copied from interface: PluginDescriptor
      Return the help / description of the plugin.
      Returns:
    • getMethodHelp

      public String getMethodHelp(int methodIndex)
      Description copied from interface: PluginDescriptor
      Return the help / description of the given method, if specified.
      Returns:
    • getKeywords

      public String[] getKeywords()
      Description copied from interface: PluginDescriptor
      Return the set of keywords.
      Returns:
      a set of keywords
    • getCategories

      public String[] getCategories()
      Description copied from interface: PluginDescriptor
      Return the set of categories.
      Returns:
      a set of categories
    • meetsQualityThreshold

      public boolean meetsQualityThreshold()
      Description copied from interface: PluginDescriptor
      Return whether this plug-in meets the quality threshold.
      Returns:
      whether this plug-in meets the quality threshold
    • meetsLevelThreshold

      public boolean meetsLevelThreshold()
      Description copied from interface: PluginDescriptor
      Return whether this plug-in meets the level threshold.
      Returns:
      whether this plug-in meets the level threshold
    • getIcon

      public ImageIcon getIcon()
    • getURL

      public URL getURL()