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

public final Class PropertyGetExecutor

extends Get
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException

Specialized executor to get a property from an object.
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final Object[]
EMPTY_PARAMS

A static signature for method().

private final String
property

The property.

Constructor Summary

AccessConstructor and Description
public
PropertyGetExecutor(Introspector
the introspector
is
,
Class<?>
the class to introspect
clazz
,
String
the property to get
identifier
)

Creates an instance by attempting discovery of the get method.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Method

Returns:

the method if found, null otherwise
discover
(Introspector
the introspector
is
,
final Class<?>
the class to find the get method from
clazz
,
String
the property name to find
property
)

Discovers the method for a PropertyGet.

pack-priv static Method

Returns:

The {get,is}{p,P}roperty method if one exists, null otherwise.
discoverGet
(Introspector
the introspector
is
,
String
"is" or "get" for boolean or object
which
,
Class<?>
The class being examined.
clazz
,
String
The property being addressed.
property
)

Base method for boolean & object property get.

public Object
execute(Object
The object to get the property from.
o
)

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

Gets the property value from an object.
public Object
getTargetProperty()

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

Gets the property targeted by this executor.
public Object
tryExecute(Object
The object to get the property from.
o
,
Object
The property to get from the object.
identifier
)

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

EMPTY_PARAMSback to summary
private static final Object[] EMPTY_PARAMS

A static signature for method().

propertyback to summary
private final String property

The property.

Constructor Detail

PropertyGetExecutorback to summary
public PropertyGetExecutor(Introspector is, Class<?> clazz, String identifier)

Creates an instance by attempting discovery of the get method.

Parameters
is:Introspector

the introspector

clazz:Class<?>

the class to introspect

identifier:String

the property to get

Method Detail

discoverback to summary
pack-priv static Method discover(Introspector is, final Class<?> clazz, String property)

Discovers the method for a PropertyGet.

The method to be found should be named "get{P,p}property.

Parameters
is:Introspector

the introspector

clazz:Class<?>

the class to find the get method from

property:String

the property name to find

Returns:Method

the method if found, null otherwise

discoverGetback to summary
pack-priv static Method discoverGet(Introspector is, String which, Class<?> clazz, String property)

Base method for boolean & object property get.

Parameters
is:Introspector

the introspector

which:String

"is" or "get" for boolean or object

clazz:Class<?>

The class being examined.

property:String

The property being addressed.

Returns:Method

The {get,is}{p,P}roperty method if one exists, null otherwise.

executeback to summary
public Object execute(Object o) throws IllegalAccessException, InvocationTargetException

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

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

Gets the property value from an object.

Parameters
o:Object

The object to get the property from.

Returns:Object

The property value.

Annotations
@Override
Exceptions
IllegalAccessException:
Method is inaccessible.
InvocationTargetException:
Method body throws an exception.
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(Object o, Object identifier)

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
o:Object

The object to get the property from.

identifier:Object

The property to get from the object.

Returns:Object

The property value or TRY_FAILED if checking failed.

Annotations
@Override