|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jexl3.internal.introspection.Introspector
public final class Introspector
This basic function of this class is to return a Method object for a particular class given the name of a method and the parameters to the method in the form of an Object[].
The first time the Introspector sees a class it creates a class method map for the class in question. Basically the class method map is a Hashtable where Method objects are keyed by the aggregation of the method name and the array of parameters classes. This mapping is performed for all the public methods of a class and stored.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
rlog
the logger. |
| Constructor Summary | |
|---|---|
Introspector(org.apache.commons.logging.Log log,
ClassLoader cloader)
Create the introspector. |
|
| Method Summary | |
|---|---|
Class<?> |
getClassByName(String className)
Gets a class by name through this introspector class loader. |
Constructor<?> |
getConstructor(Class<?> c,
MethodKey key)
Gets the constructor defined by the MethodKey. |
Constructor<?> |
getConstructor(MethodKey key)
Gets the constructor defined by the MethodKey. |
Field |
getField(Class<?> c,
String key)
Gets the field named by key for the class c. |
String[] |
getFieldNames(Class<?> c)
Gets the array of accessible field names known for a given class. |
ClassLoader |
getLoader()
Gets the class loader used by this introspector. |
Method |
getMethod(Class<?> c,
MethodKey key)
Gets the method defined by the MethodKey for the class c. |
Method |
getMethod(Class<?> c,
String name,
Object[] params)
Gets a method defined by a class, a name and a set of parameters. |
String[] |
getMethodNames(Class<?> c)
Gets the array of accessible methods names known for a given class. |
Method[] |
getMethods(Class<?> c,
String methodName)
Gets the array of accessible method known for a given class. |
void |
setLoader(ClassLoader cloader)
Sets the class loader used to solve constructors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log rlog
| Constructor Detail |
|---|
public Introspector(org.apache.commons.logging.Log log,
ClassLoader cloader)
log - the logger to usecloader - the class loader| Method Detail |
|---|
public Class<?> getClassByName(String className)
className - the class name
public Method getMethod(Class<?> c,
String name,
Object[] params)
c - the classname - the method nameparams - the method parameters
MethodKey.AmbiguousException - if no unambiguous method could be found through introspection
public Method getMethod(Class<?> c,
MethodKey key)
MethodKey for the class c.
c - Class in which the method search is taking placekey - Key of the method being searched for
MethodKey.AmbiguousException - if no unambiguous method could be found through introspection
public 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
public String[] getFieldNames(Class<?> c)
c - the class
public String[] getMethodNames(Class<?> c)
c - the class
public Method[] getMethods(Class<?> c,
String methodName)
c - the classmethodName - the method name
public Constructor<?> getConstructor(MethodKey key)
MethodKey.
key - Key of the constructor being searched for
public Constructor<?> getConstructor(Class<?> c,
MethodKey key)
MethodKey.
c - the class we want to instantiatekey - Key of the constructor being searched for
public void setLoader(ClassLoader cloader)
Also cleans the constructors and methods caches.
cloader - the class loader; if null, use this instance class loaderpublic ClassLoader getLoader()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||