Class InvokableIteratorMethod
java.lang.Object
org.nuxeo.ecm.automation.core.impl.InvokableMethod
org.nuxeo.ecm.automation.core.impl.InvokableIteratorMethod
- All Implemented Interfaces:
Comparable<InvokableMethod>
A method proxy which accept as input only iterable inputs. At invocation time it iterates over the input elements and
invoke the real method using the current input element as the input.
The result is collected into a OutputCollector as specified by the OperationMethod annotation.
This proxy is used (instead of the default InvokableMethod) when an operation is defining an output collector
in the OperationMethod annotation so that iterable inputs are automatically handled by the chain executor.
This specialized implementation is declaring the same consume type as its non-iterable counterpart. But at runtime it consumes any Iterable of the cosume type.
To correctly generate the operation documentation the OperationTypeImpl is checking if the method is iterable
or not through isIterable() to declare the correct consume type.
- Author:
- Bogdan Stefanescu
-
Field Summary
FieldsFields inherited from class org.nuxeo.ecm.automation.core.impl.InvokableMethod
ADAPTABLE_PRIORITY, asyncService, consume, EXACT_MATCH_PRIORITY, ISTANCE_OF_PRIORITY, method, op, priority, produce, USER_PRIORITY, VOID_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionInvokableIteratorMethod(OperationType op, Method method, OperationMethod anno) -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectdoInvoke(OperationContext ctx, Map<String, Object> args) intinputMatch(Class<?> in) Return 0 for no match.booleanMethods inherited from class org.nuxeo.ecm.automation.core.impl.InvokableMethod
compareTo, getAsyncService, getConsume, getExceptionMessage, getInputType, getMethod, getOperation, getOutputType, getPriority, getProduce, invoke, toString
-
Field Details
-
collector
-
-
Constructor Details
-
InvokableIteratorMethod
-
-
Method Details
-
isIterable
public boolean isIterable()- Overrides:
isIterablein classInvokableMethod
-
inputMatch
Description copied from class:InvokableMethodReturn 0 for no match.- Overrides:
inputMatchin classInvokableMethod
-
doInvoke
protected Object doInvoke(OperationContext ctx, Map<String, Object> args) throws OperationException, ReflectiveOperationException- Overrides:
doInvokein classInvokableMethod- Throws:
OperationExceptionReflectiveOperationException
-