edge - public class MacroPluginDescriptorImpl extends AbstractPluginDescriptor
| Constructor and Description |
|---|
MacroPluginDescriptorImpl(java.io.File file,
PluginManager manager,
PackageDescriptor pack) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PluginDescriptor plugin)
Compares this plugin with another plugins.
|
protected java.lang.Object[] |
execute(PluginContext context,
int methodIndex,
java.lang.Object... args)
In this method, the pluginDescriptor should do the actual work of
concstructing the result.
|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass)
Return the annotation of the given class carried by this plugin.
|
<T extends java.lang.annotation.Annotation> |
getAnnotation(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 |
getFileName() |
java.lang.String |
getHelp()
Return the help / description of the plugin.
|
PluginDescriptorID |
getID()
returns the ID of this Plugin.
|
int |
getIndexInMethod(int methodIndex,
int globalParameterIndex)
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 plugin
|
java.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 size
getNumberOfMethods(), such that
element at index i of the list equals
getParameterTypes(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 index
parameterIndex of
the method at methodIndex. |
java.lang.Class<?> |
getPluginParameterType(int methodIndex,
int parameterIndex)
Return the type of the parameter at index
parameterIndex of
the method at methodIndex. |
java.util.List<java.lang.String> |
getReturnNames()
returns the labels of the objects returned if this plugin is invoked, in
the order in which they are returned.
|
java.util.List<java.lang.Class<?>> |
getReturnTypes()
returns the types of the objects returned if this plugin is invoked, in
the order in which they are returned
|
java.util.Set<java.lang.Class<?>> |
getTypesAtParameterIndex(int globalParameterIndex)
Returns a list of types that can be accepted for the parameter at index
globalParameterIndex. |
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.
|
PluginExecutionResult |
invoke(int methodIndex,
PluginContext context,
java.lang.Object... args)
Asynchronously invokes a method of this plugin.
|
boolean |
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCodepublic MacroPluginDescriptorImpl(java.io.File file,
PluginManager manager,
PackageDescriptor pack)
throws java.io.IOException,
org.w3c.dom.DOMException,
org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException,
java.lang.ClassNotFoundException,
DependsOnUnknownException
java.io.IOExceptionorg.w3c.dom.DOMExceptionorg.xml.sax.SAXExceptionjavax.xml.parsers.ParserConfigurationExceptionjava.lang.ClassNotFoundExceptionDependsOnUnknownExceptionpublic PackageDescriptor getPackage()
PluginDescriptorpublic int compareTo(PluginDescriptor plugin)
PluginDescriptorgetName().toLowerCase() for comparing. Only if names are
equal, then the IDs are used for comparison. Comparison should be
name-based between different implementing classes.public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
PluginDescriptorpublic java.lang.Class<? extends PluginContext> getContextType(int methodIndex)
PluginDescriptormethodIndex - 0 <= methodIndex < getNumberOfMethods()public PluginDescriptorID getID()
PluginDescriptorpublic int getIndexInMethod(int methodIndex,
int globalParameterIndex)
PluginDescriptormethodIndex - 0 <= methodIndex < getNumberOfMethods()globalParameterIndex - 0 <= globalParameterIndex < getParameterNames().size()-1 <= return < getParameterNames(methodIndex).size()public int getIndexInParameterNames(int methodIndex,
int methodParameterIndex)
PluginDescriptormethodIndex - 0 <= methodIndex < getNumberOfMethods()methodParameterIndex - 0 <= methodParameterIndex < getParameterNames(methodIndex).size()0 <= return < getParameterNames().size()public java.lang.String getMethodLabel(int methodIndex)
PluginDescriptorpublic java.lang.String getName()
PluginDescriptorpublic int getNumberOfMethods()
PluginDescriptorpublic java.lang.String getPluginParameterName(int methodIndex,
int parameterIndex)
PluginDescriptorparameterIndex of
the method at methodIndex.methodIndex - 0 <= methodIndex < getNumberOfMethods()parameterIndex - 0 <= parameterIndex < getParameterTypes(methodIndex).size()public java.util.List<java.lang.String> getParameterNames()
PluginDescriptorpublic java.util.List<java.lang.String> getParameterNames(int methodIndex)
PluginDescriptormethodIndex requires exactly the parameter labels as
provided in the returned list, in that order.public java.lang.Class<?> getPluginParameterType(int methodIndex,
int parameterIndex)
PluginDescriptorparameterIndex of
the method at methodIndex.methodIndex - 0 <= methodIndex < getNumberOfMethods()parameterIndex - 0 <= parameterIndex < getParameterTypes().size()public java.util.List<java.util.List<java.lang.Class<?>>> getParameterTypes()
PluginDescriptorgetNumberOfMethods(), such that
element at index i of the list equals
getParameterTypes(i)public java.util.List<java.lang.Class<?>> getParameterTypes(int methodIndex)
PluginDescriptormethodIndex requires exectly the parameter types as provided
in the returned list, in that order.public java.util.List<java.lang.String> getReturnNames()
PluginDescriptorPluginExecutionResult object.public java.util.List<java.lang.Class<?>> getReturnTypes()
PluginDescriptorpublic java.util.Set<java.lang.Class<?>> getTypesAtParameterIndex(int globalParameterIndex)
PluginDescriptorglobalParameterIndex. 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)) == tglobalParameterIndex - 0 <= globalParameterIndex < getParameterNames().size()public boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
PluginDescriptorpublic PluginExecutionResult invoke(int methodIndex, PluginContext context, java.lang.Object... args)
PluginDescriptorcontext.getParentContext().getPluginLifeCycleEventListeners().firePluginCreated(context);invoke in interface PluginDescriptorinvoke in class AbstractPluginDescriptormethodIndex - The index of the method to be invokedcontext - the context in which this plugin should be invoked. The plugin
may assume that this context is meant only for its execution.args - the objects to be passed to the plugin. These objects should
be in the right order. However, if ProMFuture
objects are provided, the plugin will synchronize on them.
This syncrhonization is performed in a fast-fail fashion, i.e.
the first future that results in an exception during execution
will result in an exception while invoking this plugin. This
exception is caught and the context is signaled about it.protected java.lang.Object[] execute(PluginContext context, int methodIndex, java.lang.Object... args) throws java.lang.Exception
AbstractPluginDescriptorexecute in class AbstractPluginDescriptorjava.lang.Exceptionpublic java.lang.String getFileName()
public boolean isUserAccessible()
PluginDescriptorpublic boolean handlesCancel()
PluginDescriptorpublic java.lang.String toString()
PluginDescriptortoString in interface PluginDescriptortoString in class java.lang.Objectpublic <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass,
int methodIndex)
PluginDescriptorpublic boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
int methodIndex)
PluginDescriptorpublic int getMostSignificantResult()
PluginDescriptorpublic java.lang.String getHelp()
PluginDescriptorpublic java.lang.String getMethodHelp(int methodIndex)
PluginDescriptorpublic java.lang.String[] getKeywords()
PluginDescriptorpublic java.lang.String[] getCategories()
PluginDescriptorpublic boolean meetsQualityThreshold()
PluginDescriptorpublic boolean meetsLevelThreshold()
PluginDescriptor