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 Hastable where Method objects are keyed by a concatenation of the method name and the names of classes that make up the parameters. For example, a method with the following signature: public void method(String a, StringBuffer b) would be mapped by the key: "method" + "java.lang.String" + "java.lang.StringBuffer" This mapping is performed for all the methods in a class and stored.
| Modifier and Type | Class and Description |
|---|---|
| private static class | IntrospectorBase.CacheMiss
A Constructor get cache-miss. |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | classMethodMaps
Holds the method maps for the classes we know about, keyed by Class. |
| private final Map | constructibleClasses
Holds the set of classes we have introspected. |
| private final Map | constructorsMap
Holds the map of classes ctors we know about as well as unknown ones. |
| private static final Constructor | CTOR_MISS
The cache-miss marker for the constructors map. |
| private ClassLoader | loader
The class loader used to solve constructors if needed. |
| protected final Log | rlog
the logger. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: the class instance or null if it could not be foundthe class name className)Gets a class by name through this introspector class loader. |
| public Constructor | Returns: The desired constructor object or null if no unambiguous constructor could be found through introspection.Key of the constructor being searched for key)Gets the constructor defined by the |
| public Constructor | Returns: The desired constructor object or null if no unambiguous constructor could be found through introspection.the class we want to instantiate c, final MethodKey Key of the constructor being searched for key)Gets the constructor defined by the |
| public Field | |
| public String[] | Returns: the class field namesthe class c)Gets the array of accessible field names known for a given class. |
| private ClassMap | |
| public Method | |
| public String[] | Returns: the class method namesthe class c)Gets the array of accessible methods names known for a given class. |
| public Method[] | Returns: the array of methods (null or not empty)the class c, String the method name methodName)Gets the array of accessible method known for a given class. |
| private static boolean | Returns: true if clazz was loaded through the loader, false otherwisethe class loader loader, Class<?> the class to check clazz)Checks whether a class is loaded through a given class loader or one of its ascendants. |
| public void | setLoader(ClassLoader
the class loader; if null, use this instance class loader cloader)Sets the class loader used to solve constructors. |
| classMethodMaps | back to summary |
|---|---|
| private final Map<Class<?>, ClassMap> classMethodMaps Holds the method maps for the classes we know about, keyed by Class. | |
| constructibleClasses | back to summary |
|---|---|
| private final Map<String, Class<?>> constructibleClasses Holds the set of classes we have introspected. | |
| constructorsMap | back to summary |
|---|---|
| private final Map<MethodKey, Constructor<?>> constructorsMap Holds the map of classes ctors we know about as well as unknown ones. | |
| CTOR_MISS | back to summary |
|---|---|
| private static final Constructor<?> CTOR_MISS The cache-miss marker for the constructors map. | |
| loader | back to summary |
|---|---|
| private ClassLoader loader The class loader used to solve constructors if needed. | |
| rlog | back to summary |
|---|---|
| protected final Log rlog the logger. | |
| IntrospectorBase | back to summary |
|---|---|
| public IntrospectorBase(Log log) Create the introspector.
| |
| getClassByName | back to summary |
|---|---|
| public Class Gets a class by name through this introspector class loader. | |
| getConstructor | back to summary |
|---|---|
| public Constructor Gets the constructor defined by the
| |
| getConstructor | back to summary |
|---|---|
| public Constructor Gets the constructor defined by the
| |
| getField | back to summary |
|---|---|
| public Field getField(Class<?> c, String key) Gets the field named by | |
| getFieldNames | back to summary |
|---|---|
| public String[] getFieldNames(Class<?> c) Gets the array of accessible field names known for a given class. | |
| getMap | back to summary |
|---|---|
| private ClassMap getMap(Class<?> c) Gets the ClassMap for a given class. | |
| getMethod | back to summary |
|---|---|
| public Method getMethod(Class<?> c, MethodKey key) Gets the method defined by the
| |
| getMethodNames | back to summary |
|---|---|
| public String[] getMethodNames(Class<?> c) Gets the array of accessible methods names known for a given class. | |
| getMethods | back to summary |
|---|---|
| public Method[] getMethods(Class<?> c, String methodName) Gets the array of accessible method known for a given class. | |
| isLoadedBy | back to summary |
|---|---|
| private static boolean isLoadedBy(ClassLoader loader, Class<?> clazz) Checks whether a class is loaded through a given class loader or one of its ascendants.
| |
| setLoader | back to summary |
|---|---|
| public void setLoader(ClassLoader cloader) Sets the class loader used to solve constructors. Also cleans the constructors and methods caches.
| |
| Access | Constructor and Description |
|---|---|
| public |
| CacheMiss | back to summary |
|---|---|
| public CacheMiss() The constructor used as cache-miss.
| |