Class PluginParameterBinding
java.lang.Object
org.processmining.framework.plugin.PluginParameterBinding
- All Implemented Interfaces:
Comparable<PluginParameterBinding>
This class represents a binding between a method of a plugin and a set of
parameters. The semantics of this object are as follows.
First, the
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.- Author:
- bfvdonge
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Factory for instantiating PluginParameterBindings binding plugins with a given input. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(PluginParameterBinding other) boolean
Equality of bindings is based on the binding, plugin and complete status.int[]
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
Returns the method index of the method which is bound by this binding.Returns the Plugin which is bound by this binding.int
hashCode()
Returns a hashcode based on the binding, plugin and complete statusinvoke
(PluginContext context, Object... parameterObjects) Invokes the method of the plugin referenced by this binding on the given parameterObjects.
-
Method Details
-
invoke
Invokes the method of the plugin referenced by this binding on the given parameterObjects. It should be noted that the number of given parameter object should be the same as the number of parameter types provided to thetryToBind()
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 aProMFuture
on that type. In this method, the given parameters are first re-ordered according to the given binding and thengetPlugin().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 this- Parameters:
context
- 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
-- Returns:
-
getPlugin
Returns the Plugin which is bound by this binding.- Returns:
-
getBinding
public 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. For each parameter type, this array indicates to which parameter of the plugin it is bound. For each elementx
of this array is holds that0 <= x < getPlugin().getParameterNames(getMethodIndex())
If the same parameter index is provided for different parameters (i.e.getBinding()[x] == getBinding()[y]
withx != y
, then this impliest that the parameter is an array type, to which multiple objects can be connected. In other words, this implies thatgetPlugin().getParameterType(getMethodIndex(),getBinding()[x]).isArray() == true
- Returns:
-
equals
Equality of bindings is based on the binding, plugin and complete status. -
hashCode
public int hashCode()Returns a hashcode based on the binding, plugin and complete status -
getMethodIndex
public int getMethodIndex()Returns the method index of the method which is bound by this binding. When this binding is invoked, this method inside the plugin provided by getPlugin() is invoked.- Returns:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PluginParameterBinding>
-