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.
Constructor
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. | |
boolean | isAnnotationPresent (Class<?extends Annotation > annotationType) |
Annotation[] | getDeclaredAnnotations () |
Annotation[] | getAnnotations () |
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 | |
native Class[] | getParameterTypesImpl () |
native int | getModifiers () |
native Class[] | getExceptionTypesImpl () |
native String | getSignature () |
native boolean | checkAccessibility (Class<?> senderClass, Object receiver) |
public< T extends Annotation > T | getAnnotation (Class< T > annotationType) |
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 |
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] |
TODO Is this necessary? |
java.lang.reflect.AccessibleObject.AccessibleObject | ( | ) | [protected] |
AccessibleObject constructor.
AccessibleObjects can only be created by the Virtual Machine.
static void java.lang.reflect.AccessibleObject.setAccessible | ( | AccessibleObject[] | objects, | |
boolean | flag | |||
) | throws SecurityException [static] |
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").
objects | the accessible objects | |
flag | the new value for the accessible flag |
ReflectPermission
SecurityException | if the request is denied |
static Object [] java.lang.reflect.AccessibleObject.marshallArguments | ( | Class[] | parameterTypes, | |
Object[] | args | |||
) | throws IllegalArgumentException [static, package] |
TODO Document this method.
parameterTypes | ||
args |
IllegalArgumentException |
static native void java.lang.reflect.AccessibleObject.initializeClass | ( | Class<?> | clazz | ) | [static, package] |
TODO Document this method.
clazz |
static final native Class<?> java.lang.reflect.AccessibleObject.getStackClass | ( | int | depth | ) | [static, package] |
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.
native Class [] java.lang.reflect.AccessibleObject.getParameterTypesImpl | ( | ) | [package] |
TODO Document this method.
native int java.lang.reflect.AccessibleObject.getModifiers | ( | ) | [package] |
TODO Document this method.
Reimplemented in java.lang.reflect.Constructor< T >, java.lang.reflect.Field, and java.lang.reflect.Method.
native Class [] java.lang.reflect.AccessibleObject.getExceptionTypesImpl | ( | ) | [package] |
TODO Document this method.
native String java.lang.reflect.AccessibleObject.getSignature | ( | ) | [package] |
native boolean java.lang.reflect.AccessibleObject.checkAccessibility | ( | Class<?> | senderClass, | |
Object | receiver | |||
) | [package] |
TODO Document this method.
senderClass | ||
receiver |
boolean java.lang.reflect.AccessibleObject.isAccessible | ( | ) |
Returns the value of the accessible flag.
This is false if access checks are performed, true if they are skipped.
void java.lang.reflect.AccessibleObject.setAccessible | ( | boolean | flag | ) | throws SecurityException |
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").
flag | the new value for the accessible flag |
SecurityException | if the request is denied |
void java.lang.reflect.AccessibleObject.invokeV | ( | Object | receiver, | |
Object | args[] | |||
) | throws InvocationTargetException [package] |
TODO Document this method.
receiver | ||
args |
InvocationTargetException |
Object java.lang.reflect.AccessibleObject.invokeL | ( | Object | receiver, | |
Object | args[] | |||
) | throws InvocationTargetException [package] |
TODO Document this method.
receiver | ||
args |
InvocationTargetException |
int java.lang.reflect.AccessibleObject.invokeI | ( | Object | receiver, | |
Object | args[] | |||
) | throws InvocationTargetException [package] |
TODO Document this method.
receiver | ||
args |
InvocationTargetException |
long java.lang.reflect.AccessibleObject.invokeJ | ( | Object | receiver, | |
Object | args[] | |||
) | throws InvocationTargetException [package] |
TODO Document this method.
receiver | ||
args |
InvocationTargetException |
float java.lang.reflect.AccessibleObject.invokeF | ( | Object | receiver, | |
Object | args[] | |||
) | throws InvocationTargetException [package] |
TODO Document this method.
receiver | ||
args |
InvocationTargetException |
double java.lang.reflect.AccessibleObject.invokeD | ( | Object | receiver, | |
Object | args[] | |||
) | throws InvocationTargetException [package] |
TODO Document this method.
receiver | ||
args |
InvocationTargetException |
final Object [] java.lang.reflect.AccessibleObject.emptyArgs = new Object[0] [static, package] |
TODO Is this necessary?
Genereated on Tue Dec 9 14:09:48 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.