Class PropertyGetExecutor
java.lang.Object
org.apache.commons.jexl3.internal.introspection.AbstractExecutor
org.apache.commons.jexl3.internal.introspection.AbstractExecutor.Get
org.apache.commons.jexl3.internal.introspection.PropertyGetExecutor
- All Implemented Interfaces:
JexlPropertyGet
Specialized executor to get a property from an object.
- 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 Object[]
A static signature for method().private final String
The property.Fields inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
method, objectClass, TRY_FAILED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PropertyGetExecutor
(Class<?> clazz, Method method, String identifier) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertyGetExecutor
discover
(Introspector is, Class<?> clazz, String property) Discovers a PropertyGetExecutor.(package private) static Method
discoverGet
(Introspector is, String which, Class<?> clazz, String property) Base method for boolean and object property get.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
-
EMPTY_PARAMS
A static signature for method(). -
property
The property.
-
-
Constructor Details
-
PropertyGetExecutor
Creates an instance.- Parameters:
clazz
- he class the get method applies tomethod
- the method held by this executoridentifier
- the property to get
-
-
Method Details
-
discover
Discovers a PropertyGetExecutor.The method to be found should be named "get{P,p}property.
- Parameters:
is
- the introspectorclazz
- the class to find the get method fromproperty
- the property name to find- Returns:
- the executor if found, null otherwise
-
discoverGet
Base method for boolean and object property get.- Parameters:
is
- the introspectorwhich
- "is" or "get" for boolean or objectclazz
- The class being examined.property
- The property being addressed.- Returns:
- The {get,is}{p,P}roperty method if one exists, 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:
o
- the object to get the property value from.- Returns:
- the property value.
- Throws:
IllegalAccessException
InvocationTargetException
-
tryInvoke
Description copied from interface:JexlPropertyGet
Attempts to reuse this JexlPropertyGet, checking that it is compatible with the actual set of arguments.- Parameters:
o
- 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.
-