|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.reflect.AccessibleObject
public class AccessibleObject
This class must be implemented by the VM vendor. 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.
Field,
Constructor,
Method,
ReflectPermission| Field Summary | |
|---|---|
(package private) boolean |
flag
|
(package private) static Hashtable<String,String> |
trans
|
| Constructor Summary | |
|---|---|
protected |
AccessibleObject()
AccessibleObject constructor. |
| Method Summary | ||
|---|---|---|
(package private) void |
appendArrayGenericType(StringBuilder sb,
Type[] objs)
Appends names of the specified array classes to the buffer. |
|
(package private) void |
appendArrayType(StringBuilder sb,
Class[] objs)
Appends names of the specified array classes to the buffer. |
|
(package private) void |
appendArrayType(StringBuilder sb,
Class<?> obj)
Appends the specified class name to the buffer. |
|
(package private) void |
appendGenericType(StringBuilder sb,
Type obj)
Appends the generic type representation to the buffer. |
|
(package private) void |
appendSimpleType(StringBuilder sb,
Class<?>[] objs)
Appends names of the specified array classes to the buffer. |
|
|
getAnnotation(Class<T> annotationType)
Gets the Annotation for this element for the annotation type
passed, if it exists. |
|
Annotation[] |
getAnnotations()
Gets all Annotations for this element. |
|
(package private) static String |
getClassSignatureAttribute(Class clazz)
Retrieve the signature attribute from an arbitrary class. |
|
Annotation[] |
getDeclaredAnnotations()
Gets all Annotations that are explicitly declared by this
element (not inherited). |
|
(package private) static org.apache.harmony.kernel.vm.ReflectionAccess |
getReflectionAccess()
Gets the unique instance of ReflectionAccessImpl. |
|
(package private) String |
getSignature(Class<?> clazz)
Returns the signature for a class. |
|
(package private) String |
getSignatureAttribute()
Gets the Signature attribute for this instance. |
|
boolean |
isAccessible()
Returns the value of the accessible flag. |
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType)
Queries whether a given Annotation is present on the AccessibleObject. |
|
static void |
setAccessible(AccessibleObject[] objects,
boolean flag)
Attempts to set the value of the accessible flag for all the objects in the array provided. |
|
void |
setAccessible(boolean flag)
Attempts to set the value of the accessible flag. |
|
(package private) void |
setAccessibleNoCheck(boolean flag)
Sets the accessible flag on this instance without doing any checks. |
|
(package private) String |
toString(Class<?>[] types)
Returns a printable String consisting of the canonical names of the classes contained in an array. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
boolean flag
static Hashtable<String,String> trans
| Constructor Detail |
|---|
protected AccessibleObject()
| Method Detail |
|---|
public static void setAccessible(AccessibleObject[] objects,
boolean flag)
throws SecurityException
objects - the accessible objectsflag - the new value for the accessible flag
SecurityException - if the request is deniedsetAccessible(boolean),
ReflectPermissionpublic boolean isAccessible()
public void setAccessible(boolean flag)
throws SecurityException
flag - the new value for the accessible flag
SecurityException - if the request is deniedReflectPermissionvoid setAccessibleNoCheck(boolean flag)
flag - the new value for the accessible flagpublic boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
isAnnotationPresent in interface AnnotatedElementannotationType - The type of Annotation to look for.
public Annotation[] getDeclaredAnnotations()
AnnotatedElementAnnotations that are explicitly declared by this
element (not inherited).
getDeclaredAnnotations in interface AnnotatedElementAnnotations, which may be empty, but never
null.public Annotation[] getAnnotations()
AnnotatedElementAnnotations for this element.
getAnnotations in interface AnnotatedElementAnnotations, which may be empty, but never
null.public <T extends Annotation> T getAnnotation(Class<T> annotationType)
AnnotatedElementAnnotation for this element for the annotation type
passed, if it exists.
getAnnotation in interface AnnotatedElementannotationType - The Class instance of the annotation to search for.
Annotation for this element or null.String getSignature(Class<?> clazz)
clazz - The class for which a signature is required.
String toString(Class<?>[] types)
types - The array of classes.
String getSignatureAttribute()
null if not found.
static String getClassSignatureAttribute(Class clazz)
static org.apache.harmony.kernel.vm.ReflectionAccess getReflectionAccess()
ReflectionAccessImpl.
void appendArrayType(StringBuilder sb,
Class<?> obj)
sb - bufferobj - the class which name should be appended to the buffer
NullPointerException - if any of the arguments is null
void appendArrayType(StringBuilder sb,
Class[] objs)
sb - bufferobjs - array of classes to print the names
NullPointerException - if any of the arguments is null
void appendArrayGenericType(StringBuilder sb,
Type[] objs)
sb - bufferobjs - array of classes to print the names
NullPointerException - if any of the arguments is null
void appendGenericType(StringBuilder sb,
Type obj)
sb - bufferobj - the generic type which representation should be appended to the buffer
NullPointerException - if any of the arguments is null
void appendSimpleType(StringBuilder sb,
Class<?>[] objs)
sb - bufferobjs - array of classes to print the names
NullPointerException - if any of the arguments is null
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||