Class UberspectImpl
java.lang.Object
org.apache.commons.jexl2.internal.Introspector
org.apache.commons.jexl2.introspection.UberspectImpl
- All Implemented Interfaces:
Uberspect
- Direct Known Subclasses:
SandboxUberspectImpl
Implementation of Uberspect to provide the default introspective
functionality of JEXL.
This is the class to derive to customize introspection.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated.Do not use externally - will be made private in a later versionstatic final classDeprecated.Do not use externally - will be made private in a later versionstatic final classA generic indexed property container, exposes get(key) and set(key, value) and solves method call dynamically based on arguments. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectPublicly exposed special failure object returned by tryInvoke.Fields inherited from class Introspector
rlog -
Constructor Summary
ConstructorsConstructorDescriptionUberspectImpl(org.apache.commons.logging.Log runtimeLogger) Creates a new UberspectImpl. -
Method Summary
Modifier and TypeMethodDescriptionConstructor<?> getConstructor(Object ctorHandle, Object[] args, JexlInfo info) Deprecated.getConstructorMethod(Object ctorHandle, Object[] args, JexlInfo info) Returns a class constructor wrapped in a JexlMethod.Returns a class field.protected JexlPropertyGetgetIndexedGet(Object object, String name) Attempts to find an indexed-property getter in an object.Iterator<?> getIterator(Object obj, JexlInfo info) Gets an iterator from an object.Returns a JexlMethod.getPropertyGet(Object obj, Object identifier, JexlInfo info) Property getter.getPropertySet(Object obj, Object identifier, Object arg, JexlInfo info) Property setter.voidsetLoader(ClassLoader cloader) Resets this Uberspect class loader.Methods inherited from class Introspector
base, getClassByName, getConstructor, getField, getFieldNames, getGetExecutor, getMethod, getMethod, getMethodExecutor, getMethodNames, getMethods, getSetExecutor, setClassLoader, toInteger, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Uberspect
setClassLoader
-
Field Details
-
TRY_FAILED
Publicly exposed special failure object returned by tryInvoke.
-
-
Constructor Details
-
UberspectImpl
Creates a new UberspectImpl.- Parameters:
runtimeLogger- the logger used for all logging needs
-
-
Method Details
-
setLoader
Resets this Uberspect class loader.- Parameters:
cloader- the class loader to use- Since:
- 2.1
-
getIterator
Gets an iterator from an object.- Specified by:
getIteratorin interfaceUberspect- Parameters:
obj- to get the iterator forinfo- contextual information- Returns:
- an iterator over obj
-
getMethod
Returns a JexlMethod.- Specified by:
getMethodin interfaceUberspect- Parameters:
obj- the objectmethod- the method nameargs- method argumentsinfo- contextual information- Returns:
- a
JexlMethod
-
getConstructor
Deprecated.Returns a class constructor.- Specified by:
getConstructorin interfaceUberspect- Parameters:
ctorHandle- a class or class nameargs- constructor argumentsinfo- contextual information- Returns:
- a
Constructor
-
getConstructorMethod
Returns a class constructor wrapped in a JexlMethod.- Specified by:
getConstructorMethodin interfaceUberspect- Parameters:
ctorHandle- a class or class nameargs- constructor argumentsinfo- contextual information- Returns:
- a
Constructor - Since:
- 2.1
-
getPropertyGet
Property getter.Returns JexlPropertyGet appropos for ${bar.woogie}.
- Specified by:
getPropertyGetin interfaceUberspect- Parameters:
obj- the object to get the property fromidentifier- property nameinfo- contextual information- Returns:
- a
JexlPropertyGet
-
getPropertySet
Property setter.returns JelPropertySet appropos for ${foo.bar = "geir"}
.- Specified by:
getPropertySetin interfaceUberspect- Parameters:
obj- the object to get the property from.identifier- property namearg- value to setinfo- contextual information- Returns:
- a
JexlPropertySet.
-
getField
-
getIndexedGet
Attempts to find an indexed-property getter in an object. The code attempts to find the list of methods getXXX() and setXXX(). Note that this is not equivalent to the strict bean definition of indexed properties; the type of the key is not necessarily an int and the set/get arrays are not resolved.- Parameters:
object- the objectname- the container name- Returns:
- a JexlPropertyGet is successfull, null otherwise
- Since:
- 2.1
-