|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jexl3.internal.introspection.Uberspect
public class Uberspect
Implementation of Uberspect to provide the default introspective functionality of JEXL.
This is the class to derive to customize introspection.
| Nested Class Summary | |
|---|---|
protected class |
Uberspect.ArithmeticUberspect
The concrete uberspect Arithmetic class. |
| Nested classes/interfaces inherited from interface org.apache.commons.jexl3.introspection.JexlUberspect |
|---|
JexlUberspect.JexlResolver, JexlUberspect.PropertyResolver, JexlUberspect.ResolverStrategy |
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
rlog
The logger to use for all warnings and errors. |
static Object |
TRY_FAILED
Publicly exposed special failure object returned by tryInvoke. |
| Fields inherited from interface org.apache.commons.jexl3.introspection.JexlUberspect |
|---|
JEXL_STRATEGY, MAP, MAP_STRATEGY, POJO |
| Constructor Summary | |
|---|---|
Uberspect(org.apache.commons.logging.Log runtimeLogger,
JexlUberspect.ResolverStrategy sty)
Creates a new Uberspect. |
|
| Method Summary | |
|---|---|
protected Introspector |
base()
Gets the current introspector base. |
JexlArithmetic.Uberspect |
getArithmetic(JexlArithmetic arithmetic)
Gets an arithmetic operator resolver for a given arithmetic instance. |
Class<?> |
getClassByName(String className)
Gets a class by name through this introspector class loader. |
JexlMethod |
getConstructor(Object ctorHandle,
Object... args)
Returns a class constructor. |
Field |
getField(Class<?> c,
String key)
Gets the field named by key for the class
c. |
String[] |
getFieldNames(Class<?> c)
Gets the accessible field names known for a given class. |
Iterator<?> |
getIterator(Object obj)
Gets an iterator from an object. |
Method |
getMethod(Class<?> c,
MethodKey key)
Gets the method defined by key and for the Class
c. |
Method |
getMethod(Class<?> c,
String name,
Object[] params)
Gets the method defined by name and
params for the Class
c. |
JexlMethod |
getMethod(Object obj,
String method,
Object... args)
Returns a JexlMethod. |
String[] |
getMethodNames(Class<?> c)
Gets the accessible methods names known for a given class. |
Method[] |
getMethods(Class<?> c,
String methodName)
Gets all the methods with a given name from this map. |
JexlPropertyGet |
getPropertyGet(List<JexlUberspect.PropertyResolver> resolvers,
Object obj,
Object identifier)
Property getter. |
JexlPropertyGet |
getPropertyGet(Object obj,
Object identifier)
Property getter. |
JexlPropertySet |
getPropertySet(List<JexlUberspect.PropertyResolver> resolvers,
Object obj,
Object identifier,
Object arg)
Property setter. |
JexlPropertySet |
getPropertySet(Object obj,
Object identifier,
Object arg)
Property setter. |
List<JexlUberspect.PropertyResolver> |
getResolvers(JexlOperator op,
Object obj)
Applies this uberspect property resolver strategy. |
int |
getVersion()
Gets this uberspect version. |
void |
setClassLoader(ClassLoader nloader)
Sets the class loader to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Object TRY_FAILED
protected final org.apache.commons.logging.Log rlog
| Constructor Detail |
|---|
public Uberspect(org.apache.commons.logging.Log runtimeLogger,
JexlUberspect.ResolverStrategy sty)
runtimeLogger - the logger used for all logging needssty - the resolver strategy| Method Detail |
|---|
protected final Introspector base()
If the reference has been collected, this method will recreate the underlying introspector.
public void setClassLoader(ClassLoader nloader)
JexlUberspectThis increments the version.
setClassLoader in interface JexlUberspectnloader - the class loaderpublic int getVersion()
JexlUberspect
getVersion in interface JexlUberspectpublic final Class<?> getClassByName(String className)
className - the class name
public final Field getField(Class<?> c,
String key)
key for the class
c.
c - Class in which the field search is taking placekey - Name of the field being searched for
Field or null if it does not exist or is not accessiblepublic final String[] getFieldNames(Class<?> c)
c - the class
public final Method getMethod(Class<?> c,
String name,
Object[] params)
name and
params for the Class
c.
c - Class in which the method search is taking placename - Name of the method being searched forparams - An array of Objects (not Classes) that describe the
the parameters
Method
or null if no unambiguous method could be found through introspection.
public final Method getMethod(Class<?> c,
MethodKey key)
key and for the Class
c.
c - Class in which the method search is taking placekey - MethodKey of the method being searched for
Method
or null if no unambiguous method could be found through introspection.public final String[] getMethodNames(Class<?> c)
c - the class
public final Method[] getMethods(Class<?> c,
String methodName)
c - the classmethodName - the seeked methods name
public JexlMethod getMethod(Object obj,
String method,
Object... args)
JexlUberspect
getMethod in interface JexlUberspectobj - the objectmethod - the method nameargs - method arguments
JexlMethod
public List<JexlUberspect.PropertyResolver> getResolvers(JexlOperator op,
Object obj)
JexlUberspect
getResolvers in interface JexlUberspectop - the operatorobj - the object
public JexlPropertyGet getPropertyGet(Object obj,
Object identifier)
JexlUberspectreturns a JelPropertySet apropos to an expression like bar.woogie.
getPropertyGet in interface JexlUberspectobj - the object to get the property fromidentifier - property name
JexlPropertyGet or null
public JexlPropertyGet getPropertyGet(List<JexlUberspect.PropertyResolver> resolvers,
Object obj,
Object identifier)
JexlUberspect
Seeks a JexlPropertyGet apropos to an expression like bar.woogie.
JexlUberspect.ResolverStrategy.apply(JexlOperator, java.lang.Object)
getPropertyGet in interface JexlUberspectresolvers - the list of property resolvers to tryobj - the object to get the property fromidentifier - property name
JexlPropertyGet or null
public JexlPropertySet getPropertySet(Object obj,
Object identifier,
Object arg)
JexlUberspect
Seeks a JelPropertySet apropos to an expression like foo.bar = "geir".
getPropertySet in interface JexlUberspectobj - the object to get the property from.identifier - property namearg - value to set
JexlPropertySet or null
public JexlPropertySet getPropertySet(List<JexlUberspect.PropertyResolver> resolvers,
Object obj,
Object identifier,
Object arg)
JexlUberspect
Seeks a JelPropertySet apropos to an expression like foo.bar = "geir".
JexlUberspect.ResolverStrategy.apply(JexlOperator, java.lang.Object)
getPropertySet in interface JexlUberspectresolvers - the list of property resolvers to try,obj - the object to get the property fromidentifier - property namearg - value to set
JexlPropertySet or nullpublic Iterator<?> getIterator(Object obj)
JexlUberspect
getIterator in interface JexlUberspectobj - to get the iterator from
public JexlMethod getConstructor(Object ctorHandle,
Object... args)
JexlUberspect
getConstructor in interface JexlUberspectctorHandle - a class or class nameargs - constructor arguments
JexlMethodpublic JexlArithmetic.Uberspect getArithmetic(JexlArithmetic arithmetic)
JexlUberspect
getArithmetic in interface JexlUberspectarithmetic - the arithmetic instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||