Class PluginDescriptorImpl
- java.lang.Object
-
- org.processmining.framework.plugin.impl.AbstractPluginDescriptor
-
- org.processmining.framework.plugin.impl.PluginDescriptorImpl
-
- All Implemented Interfaces:
java.lang.Comparable<PluginDescriptor>
,PluginDescriptor
public class PluginDescriptorImpl extends AbstractPluginDescriptor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(PluginDescriptor plugin)
Compares this plugin with another plugins.boolean
equals(java.lang.Object other)
return equality of plugins.protected java.lang.Object[]
execute(PluginContext context, int methodIndex, java.lang.Object... allArgs)
In this method, the pluginDescriptor should do the actual work of concstructing the result.protected java.lang.reflect.Method
findMethod(java.lang.Object[] allArgs)
<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
Return the annotation of the given class carried by this plugin.<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass, int methodIndex)
Return the annotation of the method at the given index.java.lang.String[]
getCategories()
Return the set of categories.java.lang.Class<? extends PluginContext>
getContextType(int methodIndex)
Returns the context type required by the method at index methodIndex.java.lang.String
getHelp()
Return the help / description of the plugin.javax.swing.ImageIcon
getIcon()
PluginDescriptorID
getID()
returns the ID of this Plugin.int
getIndexInMethod(int methodIndex, int parameterIndex)
Returns the index of the global parameter to the index of that parameter in the given method.int
getIndexInParameterNames(int methodIndex, int methodParameterIndex)
Returns the index of the method parameter of the given method in the list of global parameters.java.lang.String[]
getKeywords()
Return the set of keywords.java.lang.String
getMethodHelp(int methodIndex)
Return the help / description of the given method, if specified.java.lang.String
getMethodLabel(int methodIndex)
Return the label of the given method, if specified.int
getMostSignificantResult()
Returns the index in the result array of the most significant result for this pluginjava.lang.String
getName()
Return the name of the plugin.int
getNumberOfMethods()
Return the number of methods in this plugin.PackageDescriptor
getPackage()
Return the package where the plug-in resides.java.util.List<java.lang.String>
getParameterNames()
Returns a list of labels that represent the possible parameters of this plugin.java.util.List<java.lang.String>
getParameterNames(int methodIndex)
Returns a list of labels that represent the required parameters of the method at the given index.java.util.List<java.util.List<java.lang.Class<?>>>
getParameterTypes()
returns a list of sizegetNumberOfMethods()
, such that element at indexi
of the list equalsgetParameterTypes(i)
java.util.List<java.lang.Class<?>>
getParameterTypes(int methodIndex)
Returns a list of types that represent the required parameters of the method at the given index.java.lang.String
getPluginParameterName(int methodIndex, int parameterIndex)
Return the label of the parameter at indexparameterIndex
of the method atmethodIndex
.java.lang.Class<?>
getPluginParameterType(int methodIndex, int parameterIndex)
Return the type of the parameter at indexparameterIndex
of the method atmethodIndex
.java.util.List<java.lang.String>
getReturnNames()
returns the types of the objects returned if this plugin is invoked, in the order in which they are returnedjava.util.List<java.lang.Class<? extends java.lang.Object>>
getReturnTypes()
returns the labels of the objects returned if this plugin is invoked, in the order in which they are returnedjava.util.Set<java.lang.Class<?>>
getTypesAtParameterIndex(int index)
Returns a list of types that can be accepted for the parameter at indexglobalParameterIndex
.java.net.URL
getURL()
boolean
handlesCancel()
Returns whether the plugin handles termination itself.boolean
hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Check if this plugin carries the given annotation.boolean
hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, int methodIndex)
Check if the method at the given index carries the given annotation.int
hashCode()
return hashcodeboolean
isUserAccessible()
Returns true if this plugin can be used by the end-users.boolean
meetsLevelThreshold()
Return whether this plug-in meets the level threshold.boolean
meetsQualityThreshold()
Return whether this plug-in meets the quality threshold.java.lang.String
toString()
Returns a String representation of the plugin-
Methods inherited from class org.processmining.framework.plugin.impl.AbstractPluginDescriptor
invoke
-
-
-
-
Method Detail
-
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(java.lang.Class<? extends java.lang.annotation.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 java.lang.annotation.Annotation> T getAnnotation(java.lang.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 java.lang.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 interfacePluginDescriptor
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:PluginDescriptor
return equality of plugins. The ID is used for equality.- Specified by:
equals
in interfacePluginDescriptor
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Description copied from interface:PluginDescriptor
Returns a String representation of the plugin- Specified by:
toString
in interfacePluginDescriptor
- Overrides:
toString
in classjava.lang.Object
-
execute
protected java.lang.Object[] execute(PluginContext context, int methodIndex, java.lang.Object... allArgs) throws java.lang.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 classAbstractPluginDescriptor
- Returns:
- Throws:
java.lang.Exception
-
findMethod
protected java.lang.reflect.Method findMethod(java.lang.Object[] allArgs)
-
getReturnTypes
public java.util.List<java.lang.Class<? extends java.lang.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 java.util.List<java.lang.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 indexmethodIndex
requires exectly the parameter types as provided in the returned list, in that order.- Returns:
-
getPluginParameterType
public java.lang.Class<?> getPluginParameterType(int methodIndex, int parameterIndex)
Description copied from interface:PluginDescriptor
Return the type of the parameter at indexparameterIndex
of the method atmethodIndex
.- 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 java.util.List<java.util.List<java.lang.Class<?>>> getParameterTypes()
Description copied from interface:PluginDescriptor
returns a list of sizegetNumberOfMethods()
, such that element at indexi
of the list equalsgetParameterTypes(i)
- Returns:
-
getParameterNames
public java.util.List<java.lang.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 java.util.Set<java.lang.Class<?>> getTypesAtParameterIndex(int index)
Description copied from interface:PluginDescriptor
Returns a list of types that can be accepted for the parameter at indexglobalParameterIndex
. The parameter index is global, i.e. not method specific. Instead, for each typet
in the set returned by this method it is guaranteed that there is at least one method (suppose at indexi
), such thatgetParameterType(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 java.util.List<java.lang.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 indexmethodIndex
requires exactly the parameter labels as provided in the returned list, in that order.- Returns:
-
getPluginParameterName
public java.lang.String getPluginParameterName(int methodIndex, int parameterIndex)
Description copied from interface:PluginDescriptor
Return the label of the parameter at indexparameterIndex
of the method atmethodIndex
.- 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 java.util.List<java.lang.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 java.lang.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 thegetName().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 java.lang.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 java.lang.annotation.Annotation> T getAnnotation(java.lang.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(java.lang.Class<? extends java.lang.annotation.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 java.lang.String getHelp()
Description copied from interface:PluginDescriptor
Return the help / description of the plugin.- Returns:
-
getMethodHelp
public java.lang.String getMethodHelp(int methodIndex)
Description copied from interface:PluginDescriptor
Return the help / description of the given method, if specified.- Returns:
-
getKeywords
public java.lang.String[] getKeywords()
Description copied from interface:PluginDescriptor
Return the set of keywords.- Returns:
- a set of keywords
-
getCategories
public java.lang.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 javax.swing.ImageIcon getIcon()
-
getURL
public java.net.URL getURL()
-
-