Top Description Fields Constructors Methods
org.apache.commons.jexl2.internal

public final Class ListGetExecutor

extends Get
Class Inheritance
Imports
java.util.List, java.lang.reflect.Array

Specialized executor to get a property from a List or array.
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final Method
ARRAY_GET

The java.lang.reflect.Array.get method used as an active marker in ListGet.

private static final Method
LIST_GET

The java.util.obj.get method used as an active marker in ListGet.

private final Integer
property

The property.

Constructor Summary

AccessConstructor and Description
public
ListGetExecutor(Introspector
the introspector
is
,
Class<?>
the class to introspect
clazz
,
Integer
the key to use in obj.get(key)
key
)

Creates an instance checking for the List interface or Array capability.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Method

Returns:

a marker method, obj.get or array.get
discover
(Class<?>
the class to introspect
clazz
)

Finds the method to perform the get on a obj of array.

public Object

Returns:

obj.get(key)
execute
(final Object
the List/array.
obj
)

Implements abstract org.apache.commons.jexl2.internal.AbstractExecutor.Get.execute.

Get the property from the obj or array.
public Object
getTargetProperty()

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.getTargetProperty.

Gets the property targeted by this executor.
public Object
tryExecute(final Object
The object to get the property from.
obj
,
Object
The property to get from the object.
key
)

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.Get.tryExecute.

Tries to reuse this executor, checking that it is compatible with the actual set of arguments.
Inherited from org.apache.commons.jexl2.internal.AbstractExecutor.Get:
invoketryInvoke

Field Detail

ARRAY_GETback to summary
private static final Method ARRAY_GET

The java.lang.reflect.Array.get method used as an active marker in ListGet.

LIST_GETback to summary
private static final Method LIST_GET

The java.util.obj.get method used as an active marker in ListGet.

propertyback to summary
private final Integer property

The property.

Constructor Detail

ListGetExecutorback to summary
public ListGetExecutor(Introspector is, Class<?> clazz, Integer key)

Creates an instance checking for the List interface or Array capability.

Parameters
is:Introspector

the introspector

clazz:Class<?>

the class to introspect

key:Integer

the key to use in obj.get(key)

Method Detail

discoverback to summary
pack-priv static Method discover(Class<?> clazz)

Finds the method to perform the get on a obj of array.

Parameters
clazz:Class<?>

the class to introspect

Returns:Method

a marker method, obj.get or array.get

executeback to summary
public Object execute(final Object obj)

Implements abstract org.apache.commons.jexl2.internal.AbstractExecutor.Get.execute.

Get the property from the obj or array.

Parameters
obj:Object

the List/array.

Returns:Object

obj.get(key)

Annotations
@Override
getTargetPropertyback to summary
public Object getTargetProperty()

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.getTargetProperty.

Doc from org.apache.commons.jexl2.internal.AbstractExecutor.getTargetProperty.

Gets the property targeted by this executor.

Returns:Object

the target property

Annotations
@Override
tryExecuteback to summary
public Object tryExecute(final Object obj, Object key)

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.Get.tryExecute.

Doc from org.apache.commons.jexl2.internal.AbstractExecutor.Get.tryExecute.

Tries to reuse this executor, checking that it is compatible with the actual set of arguments.

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).

Parameters
obj:Object

The object to get the property from.

key:Object

The property to get from the object.

Returns:Object

The property value or TRY_FAILED if checking failed.

Annotations
@Override