Class InterpreterBase.CallDispatcher
java.lang.Object
org.apache.commons.jexl3.internal.InterpreterBase.CallDispatcher
- Enclosing class:
InterpreterBase
Helping dispatch function calls.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Object[]
The actual arguments.(package private) final boolean
Whether solution is cacheable.(package private) InterpreterBase.Funcall
The cacheable funcall if any.(package private) boolean
Whether arguments have been narrowed.(package private) final JexlNode
The syntactic node.(package private) Object
The method invocation target.(package private) JexlMethod
The method to call. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
Evaluates the method previously dispatched.protected boolean
isArithmeticMethod
(String methodName, Object[] arguments) Whether the method is an arithmetic method.protected boolean
isContextMethod
(String methodName, Object[] arguments) Whether the method is a context method.protected boolean
isTargetMethod
(Object ntarget, String methodName, Object[] arguments) Whether the method is a target method.protected Object
Attempt to reuse last funcall cached in volatile JexlNode.value (if it was cacheable).
-
Field Details
-
node
The syntactic node. -
cacheable
final boolean cacheableWhether solution is cacheable. -
narrow
boolean narrowWhether arguments have been narrowed. -
vm
JexlMethod vmThe method to call. -
target
Object targetThe method invocation target. -
argv
Object[] argvThe actual arguments. -
funcall
InterpreterBase.Funcall funcallThe cacheable funcall if any.
-
-
Constructor Details
-
CallDispatcher
CallDispatcher(JexlNode anode, boolean acacheable) Dispatcher ctor.- Parameters:
anode
- the syntactic node.acacheable
- whether resolution can be cached
-
-
Method Details
-
eval
Evaluates the method previously dispatched.- Parameters:
methodName
- the method name- Returns:
- the method invocation result
- Throws:
Exception
- when invocation fails
-
isArithmeticMethod
Whether the method is an arithmetic method.- Parameters:
methodName
- the method namearguments
- the method arguments- Returns:
- true if arithmetic, false otherwise
-
isContextMethod
Whether the method is a context method.- Parameters:
methodName
- the method namearguments
- the method arguments- Returns:
- true if arithmetic, false otherwise
-
isTargetMethod
Whether the method is a target method.- Parameters:
ntarget
- the target instancemethodName
- the method namearguments
- the method arguments- Returns:
- true if arithmetic, false otherwise
-
tryEval
Attempt to reuse last funcall cached in volatile JexlNode.value (if it was cacheable).- Parameters:
ntarget
- the target instancemethodName
- the method namearguments
- the method arguments- Returns:
- TRY_FAILED if invocation was not possible or failed, the result otherwise
-