Additional Java 9 based functions will be added here as needed.
Type Params | Return Type | Name and description |
---|---|---|
|
boolean |
checkAccessible(Class<?> callerClass, Class<?> declaringClass, int memberModifiers, boolean allowIllegalAccess) |
|
boolean |
checkCanSetAccessible(AccessibleObject accessibleObject, Class<?> callerClass) This method may be used by a caller in class C to check whether to enable access to a member of declaring class D successfully if Java8#checkCanSetAccessible(java.lang.reflect.AccessibleObject, java.lang.Class) returns true and any of the following hold: |
|
Map<String, Set<String>> |
getDefaultImportClasses(String[] packageNames) |
|
Object |
getInvokeSpecialHandle(Method method, Object receiver) |
|
int |
getVersion() |
|
static MethodHandles.Lookup |
of(Class<?> declaringClass) |
|
MetaMethod |
transformMetaMethod(MetaClass metaClass, MetaMethod metaMethod, Class<?> caller) |
|
boolean |
trySetAccessible(AccessibleObject ao) |
This method may be used by a caller in class C to check whether to enable access to a member of declaring class D successfully if Java8#checkCanSetAccessible(java.lang.reflect.AccessibleObject, java.lang.Class) returns true and any of the following hold:
1) C and D are in the same module. 2) The member is public and D is public in a package that the module containing D exports to at least the module containing C. 3) The member is protected static, D is public in a package that the module containing D exports to at least the module containing C, and C is a subclass of D. 4) D is in a package that the module containing D opens to at least the module containing C. All packages in unnamed and open modules are open to all modules and so this method always succeeds when D is in an unnamed or open module.
accessibleObject
- the accessible object to checkcallerClass
- the callerClass to invoke setAccessible