public final class ListGetExecutor extends AbstractExecutor.Get
AbstractExecutor.Get, AbstractExecutor.Method, AbstractExecutor.Set
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Method |
ARRAY_GET
The java.lang.reflect.Array.get method used as an active marker in ListGet.
|
private static java.lang.reflect.Method |
LIST_GET
The java.util.obj.get method used as an active marker in ListGet.
|
private java.lang.Integer |
property
The property.
|
method, objectClass, TRY_FAILED
Constructor and Description |
---|
ListGetExecutor(Introspector is,
java.lang.Class<?> clazz,
java.lang.Integer key)
Creates an instance checking for the List interface or Array capability.
|
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.reflect.Method |
discover(java.lang.Class<?> clazz)
Finds the method to perform the get on a obj of array.
|
java.lang.Object |
execute(java.lang.Object obj)
Get the property from the obj or array.
|
java.lang.Object |
getTargetProperty()
Gets the property targeted by this executor.
|
java.lang.Object |
tryExecute(java.lang.Object obj,
java.lang.Object key)
Tries to reuse this executor, checking that it is compatible with
the actual set of arguments.
|
invoke, tryInvoke
equals, equals, getMethod, getMethodName, getTargetClass, hashCode, initMarker, isAlive, isCacheable, makeArgs, tryFailed
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isCacheable, tryFailed
private static final java.lang.reflect.Method ARRAY_GET
private static final java.lang.reflect.Method LIST_GET
private final java.lang.Integer property
public ListGetExecutor(Introspector is, java.lang.Class<?> clazz, java.lang.Integer key)
is
- the introspectorclazz
- the class to introspectkey
- the key to use in obj.get(key)public java.lang.Object getTargetProperty()
getTargetProperty
in class AbstractExecutor
public java.lang.Object execute(java.lang.Object obj)
execute
in class AbstractExecutor.Get
obj
- the List/array.public java.lang.Object tryExecute(java.lang.Object obj, java.lang.Object key)
Compatibility means that:
o
must be of the same class as this executor's
target class and
property
must be of the same class as this
executor's target property (for list and map based executors) and have the same
value (for other types).
tryExecute
in class AbstractExecutor.Get
obj
- The object to get the property from.key
- The property to get from the object.static java.lang.reflect.Method discover(java.lang.Class<?> clazz)
clazz
- the class to introspect