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

public final Class MapGetExecutor

extends Get
Class Inheritance
Imports
java.util.Map

Specialized executor to get a property from a Map.
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final Method
MAP_GET

The java.util.map.get method used as an active marker in MapGet.

private final Object
property

The property.

Constructor Summary

AccessConstructor and Description
public
MapGetExecutor(Introspector
the introspector
is
,
Class<?>
the class that might implement the map interface
clazz
,
Object
the key to use in map.get(key)
key
)

Creates an instance checking for the Map interface.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Method

Returns:

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

Finds the method to perform 'get' on a map.

public Object

Returns:

map.get(property)
execute
(final Object
the map.
obj
)

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

Get the property from the map.
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

MAP_GETback to summary
private static final Method MAP_GET

The java.util.map.get method used as an active marker in MapGet.

propertyback to summary
private final Object property

The property.

Constructor Detail

MapGetExecutorback to summary
public MapGetExecutor(Introspector is, Class<?> clazz, Object key)

Creates an instance checking for the Map interface.

Parameters
is:Introspector

the introspector

clazz:Class<?>

the class that might implement the map interface

key:Object

the key to use in map.get(key)

Method Detail

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

Finds the method to perform 'get' on a map.

Parameters
clazz:Class<?>

the class to introspect

Returns:Method

a marker method, map.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 map.

Parameters
obj:Object

the map.

Returns:Object

map.get(property)

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