Package jadex.rules.eca
Class MethodCondition
- java.lang.Object
-
- jadex.rules.eca.MethodCondition
-
- All Implemented Interfaces:
ICondition
public class MethodCondition extends java.lang.Object implements ICondition
Condition implementation that invokes a predefined method.
-
-
Field Summary
Fields Modifier and Type Field Description protected IMethodParameterGuesser
guesser
The parameter guesser.protected boolean
invert
The invert flag.protected java.lang.reflect.Method
method
The method.protected java.lang.Object
object
The object.-
Fields inherited from interface jadex.rules.eca.ICondition
FALSE, TRUE, TRUE_CONDITION
-
-
Constructor Summary
Constructors Constructor Description MethodCondition(java.lang.Object object, java.lang.reflect.Method method)
Create a new method condition.MethodCondition(java.lang.Object object, java.lang.reflect.Method method, boolean invert)
Create a new method condition.MethodCondition(java.lang.Object object, java.lang.reflect.Method method, boolean invert, IMethodParameterGuesser guesser)
Create a new method condition.MethodCondition(java.lang.Object object, java.lang.reflect.Method method, IMethodParameterGuesser guesser)
Create a new method condition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<Tuple2<java.lang.Boolean,java.lang.Object>>
evaluate(IEvent event)
Evaluate the condition.protected java.lang.Object
invokeMethod(IEvent event)
Do the method invocation.
-
-
-
Field Detail
-
object
protected java.lang.Object object
The object.
-
method
protected java.lang.reflect.Method method
The method.
-
invert
protected boolean invert
The invert flag. Inverts method result.
-
guesser
protected IMethodParameterGuesser guesser
The parameter guesser.
-
-
Constructor Detail
-
MethodCondition
public MethodCondition(java.lang.Object object, java.lang.reflect.Method method)
Create a new method condition.
-
MethodCondition
public MethodCondition(java.lang.Object object, java.lang.reflect.Method method, IMethodParameterGuesser guesser)
Create a new method condition.
-
MethodCondition
public MethodCondition(java.lang.Object object, java.lang.reflect.Method method, boolean invert)
Create a new method condition.
-
MethodCondition
public MethodCondition(java.lang.Object object, java.lang.reflect.Method method, boolean invert, IMethodParameterGuesser guesser)
Create a new method condition.
-
-
Method Detail
-
evaluate
public IFuture<Tuple2<java.lang.Boolean,java.lang.Object>> evaluate(IEvent event)
Evaluate the condition.- Specified by:
evaluate
in interfaceICondition
- Parameters:
event
- The event.- Returns:
- True, if condition is met (plus additional user data).
-
invokeMethod
protected java.lang.Object invokeMethod(IEvent event) throws java.lang.Exception
Do the method invocation.- Throws:
java.lang.Exception
-
-