Class ListGetExecutor
java.lang.Object
org.apache.commons.jexl3.internal.introspection.AbstractExecutor
org.apache.commons.jexl3.internal.introspection.AbstractExecutor.Get
org.apache.commons.jexl3.internal.introspection.ListGetExecutor
- All Implemented Interfaces:
JexlPropertyGet
Specialized executor to get a property from a List or array.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
AbstractExecutor.Get, AbstractExecutor.Method, AbstractExecutor.Set
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Method
The java.lang.reflect.Array.get method used as an active marker in ListGet.private static final Method
The java.util.obj.get method used as an active marker in ListGet.private final Integer
The property.Fields inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
method, objectClass, TRY_FAILED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ListGetExecutor
(Class<?> clazz, Method method, Integer index) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic ListGetExecutor
discover
(Introspector is, Class<?> clazz, Integer index) Attempts to discover a ListGetExecutor.Gets the property targeted by this executor.Method used to get the property value of an object.Attempts to reuse this JexlPropertyGet, checking that it is compatible with the actual set of arguments.Methods inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
castInteger, castString, classOf, equals, equals, getMethod, getMethodName, getTargetClass, hashCode, initMarker, isAlive, isCacheable, makeArgs, tryFailed
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.jexl3.introspection.JexlPropertyGet
isCacheable, tryFailed
-
Field Details
-
ARRAY_GET
The java.lang.reflect.Array.get method used as an active marker in ListGet. -
LIST_GET
The java.util.obj.get method used as an active marker in ListGet. -
property
The property.
-
-
Constructor Details
-
ListGetExecutor
Creates an instance.- Parameters:
clazz
- he class the get method applies tomethod
- the method held by this executorindex
- the index to use as an argument to the get method
-
-
Method Details
-
discover
Attempts to discover a ListGetExecutor.- Parameters:
is
- the introspectorclazz
- the class to find the get method fromindex
- the index to use as an argument to the get method- Returns:
- the executor if found, null otherwise
-
getTargetProperty
Description copied from class:AbstractExecutor
Gets the property targeted by this executor.- Overrides:
getTargetProperty
in classAbstractExecutor
- Returns:
- the target property
-
invoke
Description copied from interface:JexlPropertyGet
Method used to get the property value of an object.- Parameters:
obj
- the object to get the property value from.- Returns:
- the property value.
-
tryInvoke
Description copied from interface:JexlPropertyGet
Attempts to reuse this JexlPropertyGet, checking that it is compatible with the actual set of arguments.- Parameters:
obj
- the object to invoke the property get uponidentifier
- the property key to get- Returns:
- the result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.
-