@Deprecated(since = "6.0.0", forRemoval = true)
public class Java9
extends Java8
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
checkAccessible(Class<?> accessingClass, Class<?> declaringClass, int memberModifiers, boolean allowIllegalAccess)* check whether the member can be accessed or not *
|
|
public 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: |
|
public Map<String, Set<String>> |
getDefaultImportClasses(String[] packageNames)* Returns the default import classes: class name -> the relevant package names * *
|
|
public Class<?>[] |
getPluginDefaultGroovyMethods()* Returns plugin-specific default Groovy methods. * *
|
|
public int |
getVersion()* Gives the version the plugin is made for *
|
|
protected Lookup |
newLookup(Class<?> targetClass)* Creates a lookup capable of accessing members declared by the target class. * *
|
|
public MetaMethod |
transformMetaMethod(MetaClass metaClass, MetaMethod metaMethod, Class<?> caller)* transform meta method * *
|
|
public boolean |
trySetAccessible(AccessibleObject ao)* Set the accessible flag for this reflected object to true
* if possible.
*
*
|
* check whether the member can be accessed or not *
callerClass - callerClass the callerClass to invoke setAccessible
*declaringClass - the type of member owner
*memberModifiers - modifiers of member
*allowIllegalAccess - whether to allow illegal access
*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 class wishing to invoke setAccessible* Returns the default import classes: class name -> the relevant package names * *
packageNames - the default import package names, e.g. java.lang.
** Returns plugin-specific default Groovy methods. * *
* Gives the version the plugin is made for *
* Creates a lookup capable of accessing members declared by the target class. * *
targetClass - the lookup target
** transform meta method * *
metaClass - metaclass
*metaMethod - the original meta method
*caller - caller class, whose method sets accessible for methods
*
* Set the accessible flag for this reflected object to true
* if possible.
*
*
ao - the accessible object
*true if the accessible flag is set to true;
* false if access cannot be enabled.
*