java.lang.Objectjava.lang.reflect.AccessibleObject
All Implemented Interfaces:
AnnotatedElement
Direct Known Subclasses:
Constructor, Method, Field
Setting the {@code accessible} flag in a reflected object permits sophisticated applications with sufficient privilege, such as Java Object Serialization or other persistence mechanisms, to manipulate objects in a manner that would normally be prohibited.
1.2 - | Field Summary | ||
|---|---|---|
| boolean | override | |
| static final ReflectionFactory | reflectionFactory | |
| Constructor: |
|---|
|
| Method from java.lang.reflect.AccessibleObject Summary: |
|---|
| getAnnotation, getAnnotations, getDeclaredAnnotations, isAccessible, isAnnotationPresent, setAccessible, setAccessible |
| Methods from java.lang.Object: |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.lang.reflect.AccessibleObject Detail: |
|---|
|
|
|
|
|
First, if there is a security manager, its {@code checkPermission} method is called with a {@code ReflectPermission("suppressAccessChecks")} permission. A {@code SecurityException} is raised if {@code flag} is {@code true} but accessibility of this object may not be changed (for example, if this element object is a Constructor object for the class java.lang.Class ). A {@code SecurityException} is raised if this object is a java.lang.reflect.Constructor object for the class {@code java.lang.Class}, and {@code flag} is true. |
First, if there is a security manager, its {@code checkPermission} method is called with a {@code ReflectPermission("suppressAccessChecks")} permission. A {@code SecurityException} is raised if {@code flag} is {@code true} but accessibility of any of the elements of the input {@code array} may not be changed (for example, if the element object is a Constructor object for the class java.lang.Class ). In the event of such a SecurityException, the accessibility of objects is set to {@code flag} for array elements upto (and excluding) the element for which the exception occurred; the accessibility of elements beyond (and including) the element for which the exception occurred is unchanged. |