Class PluginDescriptorImpl2
- java.lang.Object
-
- org.processmining.framework.plugin.impl.AbstractPluginDescriptor
-
- org.processmining.logfiltering.visualizerModel.PluginDescriptorImpl2
-
- All Implemented Interfaces:
java.lang.Comparable<org.processmining.framework.plugin.PluginDescriptor>,org.processmining.framework.plugin.PluginDescriptor
public class PluginDescriptorImpl2 extends org.processmining.framework.plugin.impl.AbstractPluginDescriptor
-
-
Constructor Summary
Constructors Constructor Description PluginDescriptorImpl2(java.lang.Class<?> type, java.lang.Class<? extends org.processmining.framework.plugin.PluginContext> acceptedContext, org.processmining.framework.packages.PackageDescriptor pack)PluginDescriptorImpl2(java.lang.reflect.Method method, org.processmining.framework.packages.PackageDescriptor pack)PluginDescriptorImpl2(java.lang.String className, java.lang.String name, java.lang.Class<?>[] parTypes, org.processmining.framework.packages.PackageDescriptor pack)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(org.processmining.framework.plugin.PluginDescriptor plugin)Compares this plugin with another plugins.booleanequals(java.lang.Object other)return equality of plugins.protected java.lang.Object[]execute(org.processmining.framework.plugin.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.MethodfindMethod(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 org.processmining.framework.plugin.PluginContext>getContextType(int methodIndex)Returns the context type required by the method at index methodIndex.java.lang.StringgetHelp()Return the help / description of the plugin.javax.swing.ImageIcongetIcon()org.processmining.framework.plugin.PluginDescriptorIDgetID()returns the ID of this Plugin.intgetIndexInMethod(int methodIndex, int parameterIndex)Returns the index of the global parameter to the index of that parameter in the given method.intgetIndexInParameterNames(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.StringgetMethodHelp(int methodIndex)Return the help / description of the given method, if specified.java.lang.StringgetMethodLabel(int methodIndex)Return the label of the given method, if specified.intgetMostSignificantResult()Returns the index in the result array of the most significant result for this pluginjava.lang.StringgetName()Return the name of the plugin.intgetNumberOfMethods()Return the number of methods in this plugin.org.processmining.framework.packages.PackageDescriptorgetPackage()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 indexiof 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.StringgetPluginParameterName(int methodIndex, int parameterIndex)Return the label of the parameter at indexparameterIndexof the method atmethodIndex.java.lang.Class<?>getPluginParameterType(int methodIndex, int parameterIndex)Return the type of the parameter at indexparameterIndexof 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.URLgetURL()booleanhandlesCancel()Returns whether the plugin handles termination itself.booleanhasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Check if this plugin carries the given annotation.booleanhasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, int methodIndex)Check if the method at the given index carries the given annotation.inthashCode()return hashcodebooleanisUserAccessible()Returns true if this plugin can be used by the end-users.booleanmeetsLevelThreshold()Return whether this plug-in meets the level threshold.booleanmeetsQualityThreshold()Return whether this plug-in meets the quality threshold.java.lang.StringtoString()Returns a String representation of the plugin
-
-
-
Constructor Detail
-
PluginDescriptorImpl2
public PluginDescriptorImpl2(java.lang.reflect.Method method, org.processmining.framework.packages.PackageDescriptor pack) throws java.lang.Exception- Throws:
java.lang.Exception
-
PluginDescriptorImpl2
public PluginDescriptorImpl2(java.lang.Class<?> type, java.lang.Class<? extends org.processmining.framework.plugin.PluginContext> acceptedContext, org.processmining.framework.packages.PackageDescriptor pack) throws java.lang.Exception- Throws:
java.lang.Exception
-
PluginDescriptorImpl2
public PluginDescriptorImpl2(java.lang.String className, java.lang.String name, java.lang.Class<?>[] parTypes, org.processmining.framework.packages.PackageDescriptor pack) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
getPackage
public org.processmining.framework.packages.PackageDescriptor getPackage()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturn the package where the plug-in resides.- Returns:
-
getMostSignificantResult
public int getMostSignificantResult()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturns 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:org.processmining.framework.plugin.PluginDescriptorCheck 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:org.processmining.framework.plugin.PluginDescriptorReturn 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:org.processmining.framework.plugin.PluginDescriptorReturn the name of the plugin. This name is not unique within ProM.- Returns:
-
hashCode
public int hashCode()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorreturn hashcode- Specified by:
hashCodein interfaceorg.processmining.framework.plugin.PluginDescriptor- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorreturn equality of plugins. The ID is used for equality.- Specified by:
equalsin interfaceorg.processmining.framework.plugin.PluginDescriptor- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturns a String representation of the plugin- Specified by:
toStringin interfaceorg.processmining.framework.plugin.PluginDescriptor- Overrides:
toStringin classjava.lang.Object
-
execute
protected java.lang.Object[] execute(org.processmining.framework.plugin.PluginContext context, int methodIndex, java.lang.Object... allArgs) throws java.lang.ExceptionDescription copied from class:org.processmining.framework.plugin.impl.AbstractPluginDescriptorIn 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:
executein classorg.processmining.framework.plugin.impl.AbstractPluginDescriptor- 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:org.processmining.framework.plugin.PluginDescriptorReturns a list of types that represent the required parameters of the method at the given index. In other words, the method at indexmethodIndexrequires 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:org.processmining.framework.plugin.PluginDescriptorReturn the type of the parameter at indexparameterIndexof 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:org.processmining.framework.plugin.PluginDescriptorreturns a list of sizegetNumberOfMethods(), such that element at indexiof the list equalsgetParameterTypes(i)- Returns:
-
getParameterNames
public java.util.List<java.lang.String> getParameterNames()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturns 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:org.processmining.framework.plugin.PluginDescriptorReturns 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 typetin 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:org.processmining.framework.plugin.PluginDescriptorReturns a list of labels that represent the required parameters of the method at the given index. In other words, the method at indexmethodIndexrequires 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:org.processmining.framework.plugin.PluginDescriptorReturn the label of the parameter at indexparameterIndexof 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 org.processmining.framework.plugin.PluginDescriptorID getID()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorreturns 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 org.processmining.framework.plugin.PluginContext> getContextType(int methodIndex)
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturns the context type required by the method at index methodIndex.- Parameters:
methodIndex-0 <= methodIndex < getNumberOfMethods()- Returns:
-
compareTo
public int compareTo(org.processmining.framework.plugin.PluginDescriptor plugin)
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorCompares 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:org.processmining.framework.plugin.PluginDescriptorReturns 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:org.processmining.framework.plugin.PluginDescriptorReturns 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:org.processmining.framework.plugin.PluginDescriptorReturn 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:org.processmining.framework.plugin.PluginDescriptorReturns 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:org.processmining.framework.plugin.PluginDescriptorReturns 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:org.processmining.framework.plugin.PluginDescriptorReturn 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:org.processmining.framework.plugin.PluginDescriptorCheck 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:org.processmining.framework.plugin.PluginDescriptorReturn the help / description of the plugin.- Returns:
-
getMethodHelp
public java.lang.String getMethodHelp(int methodIndex)
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturn the help / description of the given method, if specified.- Returns:
-
getKeywords
public java.lang.String[] getKeywords()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturn the set of keywords.- Returns:
- a set of keywords
-
getCategories
public java.lang.String[] getCategories()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturn the set of categories.- Returns:
- a set of categories
-
meetsQualityThreshold
public boolean meetsQualityThreshold()
Description copied from interface:org.processmining.framework.plugin.PluginDescriptorReturn 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:org.processmining.framework.plugin.PluginDescriptorReturn 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()
-
-