org.op4j.functions
Class ExpressionFunction<T,R>

Object
  extended by org.op4j.functions.Function<T,R>
      extended by org.op4j.functions.ExpressionFunction<T,R>
All Implemented Interfaces:
IFunction<T,R>

public final class ExpressionFunction<T,R>
extends Function<T,R>

Base class for all functions returned by Fn.on(...) expressions.

This class should NEVER be used directly, nor extended by user-defined functions.

Since:
1.0
Author:
Daniel Fernández

Constructor Summary
ExpressionFunction(Target target)
           
 
Method Summary
 R execute(T input, ExecCtx ctx)
           Executes the function on the current target object, which is passed as the input parameter.
 
Methods inherited from class org.op4j.functions.Function
execute
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionFunction

public ExpressionFunction(Target target)
Method Detail

execute

public R execute(T input,
                 ExecCtx ctx)
          throws Exception
Description copied from interface: IFunction

Executes the function on the current target object, which is passed as the input parameter. The ExecCtx parameter provides some metadata related to the execution, like the index in an iteration.

The execution of a function can throw any exception.

If you intend to call the execute method directly on any of your functions (outside an op4j expression), you might prefer using Function.execute(Object) instead.

Parameters:
input - the target object on which the function is to be executed
ctx - the context (metadata) for the function execution
Returns:
the result of executing the function
Throws:
Exception


Copyright © 2012 The OP4J team. All Rights Reserved.