Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.automation.core.impl
Class InvokableIteratorMethod

java.lang.Object
  extended by org.nuxeo.ecm.automation.core.impl.InvokableMethod
      extended by org.nuxeo.ecm.automation.core.impl.InvokableIteratorMethod

public class InvokableIteratorMethod
extends 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
 
Fields inherited from class org.nuxeo.ecm.automation.core.impl.InvokableMethod
ADAPTABLE_PRIORITY, EXACT_MATCH_PRIORITY, ISTANCE_OF_PRIORITY, USER_PRIORITY, VOID_PRIORITY
 
Constructor Summary
InvokableIteratorMethod(OperationType op, Method method, OperationMethod anno)
           
 
Method Summary
 int inputMatch(Class<?> in)
          Return 0 for no match.
 boolean isIterable()
           
 
Methods inherited from class org.nuxeo.ecm.automation.core.impl.InvokableMethod
getInputType, getOperation, getOutputType, getPriority, invoke
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvokableIteratorMethod

public InvokableIteratorMethod(OperationType op,
                               Method method,
                               OperationMethod anno)
Method Detail

isIterable

public boolean isIterable()
Overrides:
isIterable in class InvokableMethod

inputMatch

public int inputMatch(Class<?> in)
Description copied from class: InvokableMethod
Return 0 for no match.

Overrides:
inputMatch in class InvokableMethod

Nuxeo Enterprise Platform 5.4

Copyright © 2011 Nuxeo SAS. All Rights Reserved.