public class PluginParameterBinding extends java.lang.Object implements java.lang.Comparable<PluginParameterBinding>
PluginParameterBinding.Factory.tryToBind()
should be used
to construct a list of PluginParameterBindings. This method is called with a
variable array of parameter types, such that for each returned binding, the
invoke()
method can be called with a variable array of
instantiations of these types, in that order.
Any reordering that needs to be done (if tryToBind()
was called
with orderedParameters == false
) is handled by the binding.
A PluginParameterBinding is only guaranteed to be executable, if the factory
method was called with mustBeTotal
set to true.Modifier and Type | Class and Description |
---|---|
static class |
PluginParameterBinding.Factory
Factory for instantiating PluginParameterBindings binding plugins with a
given input.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PluginParameterBinding other) |
boolean |
equals(java.lang.Object o)
Equality of bindings is based on the binding, plugin and complete status.
|
int[] |
getBinding()
This method returns an array of integers, of which the length corresponds
to the length of the list of parameters types provided to the
PluginParameterBinding factory.
|
int |
getMethodIndex()
Returns the method index of the method which is bound by this binding.
|
PluginDescriptor |
getPlugin()
Returns the Plugin which is bound by this binding.
|
int |
hashCode()
Returns a hashcode based on the binding, plugin and complete status
|
PluginExecutionResult |
invoke(PluginContext context,
java.lang.Object... parameterObjects)
Invokes the method of the plugin referenced by this binding on the given
parameterObjects.
|
public PluginExecutionResult invoke(PluginContext context, java.lang.Object... parameterObjects)
tryToBind()
method of the factory. Furthermore, the
types of these parameters should be right, i.e. each object should be of
the right type, or should be a ProMFuture
on that type.
In this method, the given parameters are first re-ordered according to
the given binding and then
getPlugin().invoke(getMethodIndex(), context, ...)
is
called, on the newly ordered parameters.
No checks are done if this plugin is executable or not on the given
input, it's up to the plugin to handle thiscontext
- Note that the plugin should be executable in this context.
However, since PluginContext's should be kept uniformly typed
within one instance of ProM, no checks are done here.parameterObjects
- public PluginDescriptor getPlugin()
public int[] getBinding()
x
of this array is holds that
0 <= x < getPlugin().getParameterNames(getMethodIndex())
If the same parameter index is provided for different parameters (i.e.
getBinding()[x] == getBinding()[y]
with x != y
,
then this impliest that the parameter is an array type, to which multiple
objects can be connected. In other words, this implies that
getPlugin().getParameterType(getMethodIndex(),getBinding()[x]).isArray() == true
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getMethodIndex()
public int compareTo(PluginParameterBinding other)
compareTo
in interface java.lang.Comparable<PluginParameterBinding>