| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: whether parentClass precedes or equals childClass in class loader ordera class parentClass, Class<?> another class, which may be a descendent of the first class childClass)Is the class loader of parentClass identical to, or an ancestor of, the class loader of childClass? |
| public static boolean | ensureTypeVisible(Class<?>
the supposed type of a member or symbolic reference of refc type, Class<?> the class attempting to make the reference refc)Decide if the given method type, attributed to a member or symbolic reference of a given reference class, is really visible to that class. |
| public static boolean | ensureTypeVisible(MethodType
the supposed type of a member or symbolic reference of refc type, Class<?> the class attempting to make the reference refc)Decide if the given method type, attributed to a member or symbolic reference of a given reference class, is really visible to that class. |
| pack-priv static int | |
| private static Class | |
| public static boolean | isClassAccessible(Class<?>
the symbolic reference class to which access is being checked (C) refc, Class<?> the class performing the lookup (D) lookupClass, Class<?> the class from which the lookup was teleported or null prevLookupClass, int allowed modes allowedModes)Evaluate the JVM linkage rules for access to the given class on behalf of caller. |
| public static boolean | Returns: true iff the accessing class can access such a memberthe class used in the symbolic reference to the proposed member refc, Class<?> the class in which the proposed member is actually defined defc, int modifier flags for the proposed member mods, Class<?> the class for which the access check is being made lookupClass, Class<?> the class for which the access check is being made prevLookupClass, int allowed modes allowedModes)Evaluate the JVM linkage rules for access to the given method on behalf of a caller class which proposes to perform the access. |
| public static boolean | |
| pack-priv static boolean | |
| public static boolean | Returns: whether they are in the same modulea class class1, Class<?> another class class2)Tests if two classes are in the same module. |
| public static boolean | Returns: whether they are in the same packagea class class1, Class<?> another class class2)Test if two classes have the same class loader and package qualifier. |
| public static boolean | Returns: whether they are identical or nested togethera class class1, Class<?> another class class2)Test if two classes are defined as part of the same package member (top-level class). |
| pack-priv static boolean | |
| private static boolean |
| ALL_ACCESS_MODES | back to summary |
|---|---|
| private static final int ALL_ACCESS_MODES | |
| MODULE_ALLOWED | back to summary |
|---|---|
| private static final int MODULE_ALLOWED | |
| ORIGINAL_ALLOWED | back to summary |
|---|---|
| private static final int ORIGINAL_ALLOWED | |
| PACKAGE_ALLOWED | back to summary |
|---|---|
| private static final int PACKAGE_ALLOWED | |
| PACKAGE_ONLY | back to summary |
|---|---|
| private static final int PACKAGE_ONLY | |
| PROTECTED_OR_PACKAGE_ALLOWED | back to summary |
|---|---|
| private static final int PROTECTED_OR_PACKAGE_ALLOWED | |
| UNCONDITIONAL_ALLOWED | back to summary |
|---|---|
| private static final int UNCONDITIONAL_ALLOWED | |
| VerifyAccess | back to summary |
|---|---|
| private VerifyAccess() | |
| classLoaderIsAncestor | back to summary |
|---|---|
| public static boolean classLoaderIsAncestor(Class<?> parentClass, Class<?> childClass) Is the class loader of parentClass identical to, or an ancestor of, the class loader of childClass? | |
| ensureTypeVisible | back to summary |
|---|---|
| public static boolean ensureTypeVisible(Class<?> type, Class<?> refc) Decide if the given method type, attributed to a member or symbolic reference of a given reference class, is really visible to that class. | |
| ensureTypeVisible | back to summary |
|---|---|
| public static boolean ensureTypeVisible(MethodType type, Class<?> refc) Decide if the given method type, attributed to a member or symbolic reference of a given reference class, is really visible to that class.
| |
| getClassModifiers | back to summary |
|---|---|
| pack-priv static int getClassModifiers(Class<?> c) | |
| getOutermostEnclosingClass | back to summary |
|---|---|
| private static Class | |
| isClassAccessible | back to summary |
|---|---|
| public static boolean isClassAccessible(Class<?> refc, Class<?> lookupClass, Class<?> prevLookupClass, int allowedModes) Evaluate the JVM linkage rules for access to the given class on behalf of caller. JVM Specification, 5.4.4 "Access Control"A class or interface C is accessible to a class or interface D if and only if any of the following conditions are true:
| |
| isMemberAccessible | back to summary |
|---|---|
| public static boolean isMemberAccessible(Class<?> refc, Class<?> defc, int mods, Class<?> lookupClass, Class<?> prevLookupClass, int allowedModes) Evaluate the JVM linkage rules for access to the given method on behalf of a caller class which proposes to perform the access. Return true if the caller class has privileges to invoke a method or access a field with the given properties. This requires an accessibility check of the referencing class, plus an accessibility check of the member within the class, which depends on the member's modifier flags.
The relevant properties include the defining class ( JVM Specification, 5.4.4 "Access Control"A field or method R is accessible to a class or interface D if and only if any of the following is true:
| |
| isModuleAccessible | back to summary |
|---|---|
| public static boolean isModuleAccessible(Class<?> refc, Module m1, Module m2) | |
| isRelatedClass | back to summary |
|---|---|
| pack-priv static boolean isRelatedClass(Class<?> refc, Class<?> lookupClass) | |
| isSameModule | back to summary |
|---|---|
| public static boolean isSameModule(Class<?> class1, Class<?> class2) Tests if two classes are in the same module. | |
| isSamePackage | back to summary |
|---|---|
| public static boolean isSamePackage(Class<?> class1, Class<?> class2) Test if two classes have the same class loader and package qualifier. | |
| isSamePackageMember | back to summary |
|---|---|
| public static boolean isSamePackageMember(Class<?> class1, Class<?> class2) Test if two classes are defined as part of the same package member (top-level class). If this is true, they can share private access with each other. | |
| isSubClass | back to summary |
|---|---|
| pack-priv static boolean isSubClass(Class<?> lookupClass, Class<?> defc) | |
| loadersAreRelated | back to summary |
|---|---|
| private static boolean loadersAreRelated(ClassLoader loader1, ClassLoader loader2, boolean loader1MustBeParent) | |