Inheritance diagram for java.lang.reflect.AccessibleObject:
This class is the superclass of all member reflect classes (Field, Constructor, Method). AccessibleObject provides the ability to toggle access checks for these objects. By default accessing a member (for example, setting a field or invoking a method) checks the validity of the access (for example, invoking a private method from outside the defining class is prohibited) and throws IllegalAccessException if the operation is not permitted. If the accessible flag is set to true, these checks are omitted. This allows privileged applications such as Java Object Serialization, inspectors, and debuggers to have complete access to objects.
ReflectPermission
Public Member Functions | |
boolean | isAccessible () |
Returns the value of the accessible flag. | |
void | setAccessible (boolean flag) throws SecurityException |
Attempts to set the value of the accessible flag. | |
Static Public Member Functions | |
static void | setAccessible (AccessibleObject[] objects, boolean flag) throws SecurityException |
Attempts to set the value of the accessible flag for all the objects in the array provided. | |
Protected Member Functions | |
AccessibleObject () | |
AccessibleObject constructor. | |
Package Functions | |
void | invokeV (Object receiver, Object args[]) throws InvocationTargetException |
Object | invokeL (Object receiver, Object args[]) throws InvocationTargetException |
int | invokeI (Object receiver, Object args[]) throws InvocationTargetException |
long | invokeJ (Object receiver, Object args[]) throws InvocationTargetException |
float | invokeF (Object receiver, Object args[]) throws InvocationTargetException |
double | invokeD (Object receiver, Object args[]) throws InvocationTargetException |
native Class[] | getParameterTypesImpl () |
native int | getModifiers () |
native Class[] | getExceptionTypesImpl () |
native String | getSignature () |
native boolean | checkAccessibility (Class senderClass, Object receiver) |
Static Package Functions | |
static Object[] | marshallArguments (Class[] parameterTypes, Object[] args) throws IllegalArgumentException |
static native void | initializeClass (Class clazz) |
static final native Class | getStackClass (int depth) |
Answer the class at depth. | |
Static Package Attributes | |
static final Object[] | emptyArgs = new Object[0] |
|
AccessibleObject constructor. AccessibleObjects can only be created by the Virtual Machine. |
|
Returns the value of the accessible flag. This is false if access checks are performed, true if they are skipped.
|
|
Attempts to set the value of the accessible flag for all the objects in the array provided. Only one security check is performed. Setting this flag to false will enable access checks, setting to true will disable them. If there is a security manager, checkPermission is called with a ReflectPermission("suppressAccessChecks").
|
|
Attempts to set the value of the accessible flag. Setting this flag to false will enable access checks, setting to true will disable them. If there is a security manager, checkPermission is called with a ReflectPermission("suppressAccessChecks").
|
|
Answer the class at depth. Notes: 1) This method operates on the defining classes of methods on stack. NOT the classes of receivers. 2) The item at index zero describes the caller of this method. |