public class IntrospectorBase extends Object
Constructor and Description |
---|
IntrospectorBase(Log log)
Create the introspector.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Method |
getMethod(Class<?> c,
MethodKey key)
Gets the method defined by the
MethodKey for the class c . |
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.
|
protected final Log rlog
public IntrospectorBase(Log log)
log
- the logger to usepublic Class<?> getClassByName(String className)
className
- the class namepublic 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 forMethodKey.AmbiguousException
- if no unambiguous method could be found through introspectionpublic 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 forpublic String[] getFieldNames(Class<?> c)
c
- the classpublic String[] getMethodNames(Class<?> c)
c
- the classpublic Method[] getMethods(Class<?> c, String methodName)
c
- the classmethodName
- the method namepublic void setLoader(ClassLoader cloader)
Also cleans the constructors and methods caches.
cloader
- the class loader; if null, use this instance class loaderpublic Constructor<?> getConstructor(MethodKey key)
MethodKey
.key
- Key of the constructor being searched forpublic Constructor<?> getConstructor(Class<?> c, MethodKey key)
MethodKey
.c
- the class we want to instantiatekey
- Key of the constructor being searched forCopyright © 2016 Internet2. All rights reserved.