| Modifier and Type | Class and Description |
|---|---|
| public class | ReflectionDriver.
Caches class members. |
| Modifier and Type | Field and Description |
|---|---|
| private static Method | |
| private final SingletonMap | |
| private static Method |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract Class | |
| protected Field | Returns: TheField object for the requested field name, or null if no such field was found in the
class.the class. cls, final Object the object instance, or null for a static field. obj, final String The name of the field. fieldName)Get the field of the class that has a given field name. |
| protected Field | Returns: TheField object for the requested field name, or null if no such field was found in the
class.the object instance, or null for a static field. obj, final String The name of the field. fieldName)Get the non-static field of the class that has a given field name. |
| protected Method | Returns: TheMethod object for the matching method, or null if no such method was found in the class.the object instance, or null for a static method. obj, final String The name of the method. methodName, final Class<?>... The types of the parameters of the method. For primitive-typed parameters, use e.g. Integer.TYPE. paramTypes)Get a non-static method by name and parameter types. |
| protected Method | Returns: TheMethod object for the matching method, or null if no such method was found in the class.the class. cls, final Object the object instance, or null for a static method. obj, final String The name of the method. methodName, final Class<?>... The types of the parameters of the method. For primitive-typed parameters, use e.g. Integer.TYPE. paramTypes)Get a method by name and parameter types. |
| protected Field | Returns: TheField object for the requested field name, or null if no such field was found in the
class.the class. cls, final String The name of the field. fieldName)Get the static field of the class that has a given field name. |
| protected Method | Returns: TheMethod object for the matching method, or null if no such method was found in the class.the class. cls, final String The name of the method. methodName, final Class<?>... The types of the parameters of the method. For primitive-typed parameters, use e.g. Integer.TYPE. paramTypes)Get a static method by name and parameter types. |
| pack-priv abstract < the generic type T> Constructor | Returns: the declared constructorsthe class cls)Get declared constructors for class. |
| pack-priv abstract Field[] | |
| pack-priv abstract Method[] | Returns: the declared methodsthe class cls)Get declared methods for class. |
| pack-priv abstract Object | |
| pack-priv abstract Object | Returns: the static fieldthe static field field)Get the value of a static field, boxing the value if necessary. |
| pack-priv abstract Object | Returns: the return value (possibly a boxed value)the object instance to invoke the method on object, final Method the non-static method method, final Object... the method arguments (or args)new Object[0] if there are no args)Invoke a non-static method, boxing the result if necessary. |
| pack-priv abstract Object | Returns: the return value (possibly a boxed value)the static method method, final Object... the method arguments (or args)new Object[0] if there are no args)Invoke a static method, boxing the result if necessary. |
| pack-priv boolean | Returns: true if accessible.the object instance, or null if static. instance, final AccessibleObject the field or method. fieldOrMethod)Check whether a field or method is accessible. |
| pack-priv abstract boolean | Returns: true if successful.the object instance, or null if static. instance, final AccessibleObject the field or method. fieldOrMethod)Make a field or method accessible. |
| pack-priv abstract void | |
| pack-priv abstract void | setStaticField(final Field
the static field field, Object the value to set value)Set the value of a static field, unboxing the value if necessary. |
| canAccessMethod | back to summary |
|---|---|
| private static Method canAccessMethod | |
| classToClassMemberCache | back to summary |
|---|---|
| private final SingletonMap<Class<?>, ReflectionDriver. | |
| isAccessibleMethod | back to summary |
|---|---|
| private static Method isAccessibleMethod | |
| ReflectionDriver | back to summary |
|---|---|
| pack-priv ReflectionDriver() | |
| findClass | back to summary |
|---|---|
| pack-priv abstract Class Find a class by name. | |
| findField | back to summary |
|---|---|
| protected Field findField(final Class<?> cls, final Object obj, final String fieldName) throws Exception Get the field of the class that has a given field name. | |
| findInstanceField | back to summary |
|---|---|
| protected Field findInstanceField(final Object obj, final String fieldName) throws Exception Get the non-static field of the class that has a given field name. | |
| findInstanceMethod | back to summary |
|---|---|
| protected Method findInstanceMethod(final Object obj, final String methodName, final Class<?>... paramTypes) throws Exception Get a non-static method by name and parameter types. | |
| findMethod | back to summary |
|---|---|
| protected Method findMethod(final Class<?> cls, final Object obj, final String methodName, final Class<?>... paramTypes) throws Exception Get a method by name and parameter types. | |
| findStaticField | back to summary |
|---|---|
| protected Field findStaticField(final Class<?> cls, final String fieldName) throws Exception Get the static field of the class that has a given field name. | |
| findStaticMethod | back to summary |
|---|---|
| protected Method findStaticMethod(final Class<?> cls, final String methodName, final Class<?>... paramTypes) throws Exception Get a static method by name and parameter types. | |
| getDeclaredConstructors | back to summary |
|---|---|
| pack-priv abstract <T> Constructor Get declared constructors for class.
| |
| getDeclaredFields | back to summary |
|---|---|
| pack-priv abstract Field[] getDeclaredFields(Class<?> cls) throws Exception Get declared fields for class. | |
| getDeclaredMethods | back to summary |
|---|---|
| pack-priv abstract Method[] getDeclaredMethods(Class<?> cls) throws Exception Get declared methods for class. | |
| getField | back to summary |
|---|---|
| pack-priv abstract Object getField(final Object object, final Field field) throws Exception Get the value of a non-static field, boxing the value if necessary. | |
| getStaticField | back to summary |
|---|---|
| pack-priv abstract Object getStaticField(final Field field) throws Exception Get the value of a static field, boxing the value if necessary. | |
| invokeMethod | back to summary |
|---|---|
| pack-priv abstract Object invokeMethod(final Object object, final Method method, final Object... args) throws Exception Invoke a non-static method, boxing the result if necessary. | |
| invokeStaticMethod | back to summary |
|---|---|
| pack-priv abstract Object invokeStaticMethod(final Method method, final Object... args) throws Exception Invoke a static method, boxing the result if necessary. | |
| isAccessible | back to summary |
|---|---|
| pack-priv boolean isAccessible(final Object instance, final AccessibleObject fieldOrMethod) Check whether a field or method is accessible. N.B. this is overridden in Narcissus driver to just return true, since everything is accessible to JNI.
| |
| makeAccessible | back to summary |
|---|---|
| pack-priv abstract boolean makeAccessible(final Object instance, final AccessibleObject fieldOrMethod) Make a field or method accessible.
| |
| setField | back to summary |
|---|---|
| pack-priv abstract void setField(final Object object, final Field field, Object value) throws Exception Set the value of a non-static field, unboxing the value if necessary. | |
| setStaticField | back to summary |
|---|---|
| pack-priv abstract void setStaticField(final Field field, Object value) throws Exception Set the value of a static field, unboxing the value if necessary. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void |
| fieldNameToField | back to summary |
|---|---|
| private final Map<String, Field> fieldNameToField | |
| methodNameToMethods | back to summary |
|---|---|
| private final Map<String, List<Method>> methodNameToMethods | |
| ClassMemberCache | back to summary |
|---|---|
| private ClassMemberCache(final Class<?> cls) throws Exception | |
| cacheField | back to summary |
|---|---|
| private void cacheField(final Field field) | |
| cacheMethod | back to summary |
|---|---|
| private void cacheMethod(final Method method) | |