AccessibleObject#setAccessible(boolean) to access non-public fields if
necessary).
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private static Class | |
| private static Method | |
| private static Class | |
| private static Method | |
| private static Method |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private <T> T | doPrivileged(final Callable<T> callable)
Call a method in the AccessController.doPrivileged(PrivilegedAction) context, using reflection, if possible (AccessController is deprecated in JDK 17). |
| pack-priv Class | findClass(final String
the class name className)Implements abstract nonapi. Find a class by name. |
| pack-priv <T> Constructor | getDeclaredConstructors(final Class<T>
the class cls)Implements abstract nonapi. Get declared constructors for class. |
| pack-priv Field[] | getDeclaredFields(final Class<?>
the class cls)Implements abstract nonapi. Get declared fields for class. |
| pack-priv Method[] | getDeclaredMethods(final Class<?>
the class cls)Implements abstract nonapi. Get declared methods for class. |
| pack-priv Object | getField(final Object
the object instance to get the field value from object, final Field the non-static field field)Implements abstract nonapi. Get the value of a non-static field, boxing the value if necessary. |
| pack-priv Object | getStaticField(final Field
the static field field)Implements abstract nonapi. Get the value of a static field, boxing the value if necessary. |
| pack-priv Object | invokeMethod(final Object
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)Implements abstract nonapi. Invoke a non-static method, boxing the result if necessary. |
| pack-priv Object | invokeStaticMethod(final Method
the static method method, final Object... the method arguments (or args)new Object[0] if there are no args)Implements abstract nonapi. Invoke a static method, boxing the result if necessary. |
| public boolean | makeAccessible(final Object
the object instance, or null if static. instance, final AccessibleObject the field or method. obj)Implements abstract nonapi. Make a field or method accessible. |
| pack-priv void | setField(final Object
the object instance to get the field value from object, final Field the non-static field field, final Object the value to set value)Implements abstract nonapi. Set the value of a non-static field, unboxing the value if necessary. |
| pack-priv void | setStaticField(final Field
the static field field, final Object the value to set value)Implements abstract nonapi. Set the value of a static field, unboxing the value if necessary. |
| private static boolean |
| accessControllerClass | back to summary |
|---|---|
| private static Class<?> accessControllerClass | |
| accessControllerDoPrivileged | back to summary |
|---|---|
| private static Method accessControllerDoPrivileged | |
| privilegedActionClass | back to summary |
|---|---|
| private static Class<?> privilegedActionClass | |
| setAccessibleMethod | back to summary |
|---|---|
| private static Method setAccessibleMethod | |
| trySetAccessibleMethod | back to summary |
|---|---|
| private static Method trySetAccessibleMethod | |
| StandardReflectionDriver | back to summary |
|---|---|
| pack-priv StandardReflectionDriver() | |
| doPrivileged | back to summary |
|---|---|
| private <T> T doPrivileged(final Callable<T> callable) throws Throwable Call a method in the AccessController.doPrivileged(PrivilegedAction) context, using reflection, if possible (AccessController is deprecated in JDK 17).
| |
| findClass | back to summary |
|---|---|
| pack-priv Class Implements abstract nonapi. Doc from nonapi. Find a class by name. | |
| getDeclaredConstructors | back to summary |
|---|---|
| pack-priv <T> Constructor Implements abstract nonapi. Doc from nonapi. Get declared constructors for class.
| |
| getDeclaredFields | back to summary |
|---|---|
| pack-priv Field[] getDeclaredFields(final Class<?> cls) throws Exception Implements abstract nonapi. Doc from nonapi. Get declared fields for class. | |
| getDeclaredMethods | back to summary |
|---|---|
| pack-priv Method[] getDeclaredMethods(final Class<?> cls) throws Exception Implements abstract nonapi. Doc from nonapi. Get declared methods for class. | |
| getField | back to summary |
|---|---|
| pack-priv Object getField(final Object object, final Field field) throws Exception Implements abstract nonapi. Doc from nonapi. Get the value of a non-static field, boxing the value if necessary. | |
| getStaticField | back to summary |
|---|---|
| pack-priv Object getStaticField(final Field field) throws Exception Implements abstract nonapi. Doc from nonapi. Get the value of a static field, boxing the value if necessary. | |
| invokeMethod | back to summary |
|---|---|
| pack-priv Object invokeMethod(final Object object, final Method method, final Object... args) throws Exception Implements abstract nonapi. Doc from nonapi. Invoke a non-static method, boxing the result if necessary. | |
| invokeStaticMethod | back to summary |
|---|---|
| pack-priv Object invokeStaticMethod(final Method method, final Object... args) throws Exception Implements abstract nonapi. Doc from nonapi. Invoke a static method, boxing the result if necessary. | |
| makeAccessible | back to summary |
|---|---|
| public boolean makeAccessible(final Object instance, final AccessibleObject obj) Implements abstract nonapi. Doc from nonapi. Make a field or method accessible.
| |
| setField | back to summary |
|---|---|
| pack-priv void setField(final Object object, final Field field, final Object value) throws Exception Implements abstract nonapi. Doc from nonapi. Set the value of a non-static field, unboxing the value if necessary. | |
| setStaticField | back to summary |
|---|---|
| pack-priv void setStaticField(final Field field, final Object value) throws Exception Implements abstract nonapi. Doc from nonapi. Set the value of a static field, unboxing the value if necessary. | |
| tryMakeAccessible | back to summary |
|---|---|
| private static boolean tryMakeAccessible(final AccessibleObject obj) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(final Object
the proxy instance that the method was invoked on proxy, final Method the method, final Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Processes a method invocation on a proxy instance and returns the result. |
| callable | back to summary |
|---|---|
| private final Callable<T> callable | |
| PrivilegedActionInvocationHandler | back to summary |
|---|---|
| public PrivilegedActionInvocationHandler(final Callable<T> callable) | |
| invoke | back to summary |
|---|---|
| public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |