| Modifier and Type | Field and Description |
|---|---|
| public static final Set | |
| private static volatile Map | fieldFilterMap
Used to filter out fields and methods from certain classes from public view, where they are sensitive or they may contain VM-internal objects. |
| private static volatile Map | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the display stringmodifier input modifiers)Returns a display string for the access control modifier status. |
| public static void | appendAccessControlModifiers(StringBuilder
the buffer sb, int the modifiers modifiers)Adds the public/protected/private access control modifiers to a display buffer. |
| public static native boolean | areNestMates(Class<?> currentClass, Class<?> memberClass)
Returns true if |
| public static void | ensureMemberAccess(Class<?>
the class performing the access currentClass, Class<?> the declaring class of the member being accessed memberClass, Class<?> the class of target object if accessing instance
field or method;
or the declaring class if accessing constructor;
or null if accessing static field or method targetClass, int the member's access modifiers modifiers)Ensures that access to a member is granted and throws IllegalAccessException if not. |
| public static void | |
| private static Member[] | |
| public static Field[] | |
| public static Method[] | |
| public static native Class | getCallerClass()
Returns the class of the caller of the method calling this method, ignoring frames associated with java.lang.reflect.Method.invoke() and its implementation. |
| public static int | |
| public static boolean | isCallerSensitive(Method m)
Tests if the given method is caller-sensitive and the declaring class is defined by either the bootstrap class loader or platform class loader. |
| private static boolean | |
| pack-priv static boolean | |
| public static boolean | |
| private static String | |
| public static IllegalAccessException | newIllegalAccessException(Class<?> currentClass, Class<?> memberClass, Class<?> targetClass, int modifiers)
Returns an IllegalAccessException with an exception message based on the access that is denied. |
| private static IllegalAccessException | newIllegalAccessException(Class<?> memberClass, int modifiers)
Returns an IllegalAccessException with an exception message where there is no caller frame. |
| public static synchronized void | |
| private static Map | |
| public static synchronized void | |
| public static boolean | Returns: true if access to member is grantedthe class performing the access currentClass, Class<?> the declaring class of the member being accessed memberClass, Class<?> the class of target object if accessing instance
field or method;
or the declaring class if accessing constructor;
or null if accessing static field or method targetClass, int the member's access modifiers modifiers)Verify access to a member and return |
| public static boolean | verifyModuleAccess(Module currentModule, Class<?> memberClass)
Returns |
| public static boolean |
| ALL_MEMBERS | back to summary |
|---|---|
| public static final Set<String> ALL_MEMBERS | |
| fieldFilterMap | back to summary |
|---|---|
| private static volatile Map<Class<?>, Set<String>> fieldFilterMap Used to filter out fields and methods from certain classes from public view, where they are sensitive or they may contain VM-internal objects. These Maps are updated very rarely. Rather than synchronize on each access, we use copy-on-write | |
| methodFilterMap | back to summary |
|---|---|
| private static volatile Map<Class<?>, Set<String>> methodFilterMap | |
| WILDCARD | back to summary |
|---|---|
| private static final String WILDCARD | |
| Reflection | back to summary |
|---|---|
| public Reflection() | |
| accessControlStatus | back to summary |
|---|---|
| public static String accessControlStatus(int modifiers) Returns a display string for the access control modifier status. In particular, this prints "package-private" status. Reports upon an illegal modifier input.
| |
| appendAccessControlModifiers | back to summary |
|---|---|
| public static void appendAccessControlModifiers(StringBuilder sb, int modifiers) Adds the public/protected/private access control modifiers to a display buffer.
| |
| areNestMates | back to summary |
|---|---|
| public static native boolean areNestMates(Class<?> currentClass, Class<?> memberClass) Returns true if | |
| ensureMemberAccess | back to summary |
|---|---|
| public static void ensureMemberAccess(Class<?> currentClass, Class<?> memberClass, Class<?> targetClass, int modifiers) throws IllegalAccessException Ensures that access to a member is granted and throws IllegalAccessException if not.
| |
| ensureNativeAccess | back to summary |
|---|---|
public static void ensureNativeAccess(Class<?> currentClass, Class<?> owner, String methodName, boolean jni)
| |
| filter | back to summary |
|---|---|
| private static Member[] filter(Member[] members, Set<String> filteredNames) | |
| filterFields | back to summary |
|---|---|
| public static Field[] filterFields(Class<?> containingClass, Field[] fields) | |
| filterMethods | back to summary |
|---|---|
| public static Method[] filterMethods(Class<?> containingClass, Method[] methods) | |
| getCallerClass | back to summary |
|---|---|
| public static native Class Returns the class of the caller of the method calling this method, ignoring frames associated with java.lang.reflect.Method.invoke() and its implementation.
| |
| getClassAccessFlags | back to summary |
|---|---|
| public static int getClassAccessFlags(Class<?> c) Retrieves the access flags written to the class file. For inner classes these flags may differ from those returned by Class.getModifiers(), which searches the InnerClasses attribute to find the source-level access flags. This is used instead of Class.getModifiers() for run-time access checks due to compatibility reasons; see 4471811. Only the values of the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be valid. | |
| isCallerSensitive | back to summary |
|---|---|
| public static boolean isCallerSensitive(Method m) Tests if the given method is caller-sensitive and the declaring class is defined by either the bootstrap class loader or platform class loader. | |
| isSameClassPackage | back to summary |
|---|---|
| private static boolean isSameClassPackage(Class<?> c1, Class<?> c2) Returns true if two classes in the same package. | |
| isSubclassOf | back to summary |
|---|---|
| pack-priv static boolean isSubclassOf(Class<?> queryClass, Class<?> ofClass) | |
| isTrustedFinalField | back to summary |
|---|---|
| public static boolean isTrustedFinalField(Field field) | |
| msgSuffix | back to summary |
|---|---|
| private static String msgSuffix(int modifiers) | |
| newIllegalAccessException | back to summary |
|---|---|
| public static IllegalAccessException newIllegalAccessException(Class<?> currentClass, Class<?> memberClass, Class<?> targetClass, int modifiers) Returns an IllegalAccessException with an exception message based on the access that is denied. | |
| newIllegalAccessException | back to summary |
|---|---|
| private static IllegalAccessException newIllegalAccessException(Class<?> memberClass, int modifiers) Returns an IllegalAccessException with an exception message where there is no caller frame. | |
| registerFieldsToFilter | back to summary |
|---|---|
| public static synchronized void registerFieldsToFilter(Class<?> containingClass, Set<String> fieldNames) | |
| registerFilter | back to summary |
|---|---|
| private static Map | |
| registerMethodsToFilter | back to summary |
|---|---|
| public static synchronized void registerMethodsToFilter(Class<?> containingClass, Set<String> methodNames) | |
| verifyMemberAccess | back to summary |
|---|---|
| public static boolean verifyMemberAccess(Class<?> currentClass, Class<?> memberClass, Class<?> targetClass, int modifiers) Verify access to a member and return
| |
| verifyModuleAccess | back to summary |
|---|---|
| public static boolean verifyModuleAccess(Module currentModule, Class<?> memberClass) Returns | |
| verifyPublicMemberAccess | back to summary |
|---|---|
| public static boolean verifyPublicMemberAccess(Class<?> memberClass, int modifiers) | |