public static class PluginParameterBinding.Factory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.List<PluginParameterBinding> |
tryToBind(PluginManager manager,
PluginDescriptor plugin,
int methodIndex,
boolean mustBeTotal,
boolean orderedParameters,
java.lang.Class<?>... parameterTypes)
This method instantiates binding objects binding the method and index
methodIndex of the given plugin to the given set of
parameter types, if possible. |
public static java.util.List<PluginParameterBinding> tryToBind(PluginManager manager, PluginDescriptor plugin, int methodIndex, boolean mustBeTotal, boolean orderedParameters, java.lang.Class<?>... parameterTypes)
methodIndex
of the given plugin to the given set of
parameter types, if possible. If no binding is possible, an empty
list is returned.
If a total binding is requested (indicated by
mustBeTotal == true
), then the returned binding assigns
objects from the given parameters to all inputParameters of the
plugin method.
If no total binding is required, the resulting bindings is not
necessarily executable, as the method bound might require more input.
However, all provided parameterTypes are bound to a parameter.
Using the flag orderedParameters
the user can request
bindings that consider the given parameters, in the given order only,
i.e. no reordering is done. Any binding b
returned with
orderedParameters == true
will satisfy the property that
b.getBinding()[i] == i
for all i
.plugin
- the plugin for which to try to bind the parametersmustBeTotal
- indicating whether the resulting binding should be totalorderedParameters
- whether or not the parameters are ordered.parameterTypes
- the available types to be distributed over the parameters.
Note that if one of the objects is a Object[] then, this
array will be kept as one. Multiple objects of type T,
might end up in an array of type S super T, i.e. they can
be bound into one S[] to be passed to a single element of
plugin.getTypes()