Constructor and Description |
---|
Java8() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkAccessible(Class<?> callerClass,
Class<?> declaringClass,
int memberModifiers,
boolean allowIllegalAccess)
check whether the member can be accessed or not
|
boolean |
checkCanSetAccessible(AccessibleObject accessibleObject,
Class<?> callerClass)
The following scenarios can not set accessible, i.e.
|
void |
configureAnnotation(AnnotationNode node) |
void |
configureAnnotationNodeFromDefinition(AnnotationNode definition,
AnnotationNode root) |
void |
configureClassNode(CompileUnit compileUnit,
ClassNode classNode) |
static GenericsType |
configureTypeVariableDefinition(ClassNode base,
ClassNode[] cBounds) |
static ClassNode |
configureTypeVariableReference(String name) |
protected int |
getElementCode(ElementType value) |
Object |
getInvokeSpecialHandle(Method method,
Object receiver)
Returns a handle with bound receiver to invokeSpecial the given method.
|
Class<?>[] |
getPluginDefaultGroovyMethods() |
Class<?>[] |
getPluginStaticGroovyMethods() |
int |
getVersion()
Gives the version the plugin is made for
|
void |
invalidateCallSites() |
Object |
invokeHandle(Object handle,
Object[] args)
Invokes a handle produced by #getInvokeSpecialdHandle
|
protected Parameter |
makeParameter(CompileUnit cu,
Type type,
Class<?> cl,
Annotation[] annotations,
String name) |
protected Parameter[] |
processParameters(CompileUnit compileUnit,
Method m) |
void |
setAdditionalClassInformation(ClassNode cn) |
MetaMethod |
transformMetaMethod(MetaClass metaClass,
MetaMethod metaMethod)
transform meta method.
|
MetaMethod |
transformMetaMethod(MetaClass metaClass,
MetaMethod metaMethod,
Class<?> caller)
transform meta method
|
boolean |
trySetAccessible(AccessibleObject ao)
Set the
accessible flag for this reflected object to true
if possible. |
public static GenericsType configureTypeVariableDefinition(ClassNode base, ClassNode[] cBounds)
public Class<?>[] getPluginDefaultGroovyMethods()
getPluginDefaultGroovyMethods
in interface VMPlugin
public int getVersion()
VMPlugin
getVersion
in interface VMPlugin
protected int getElementCode(ElementType value)
protected Parameter[] processParameters(CompileUnit compileUnit, Method m)
public void setAdditionalClassInformation(ClassNode cn)
setAdditionalClassInformation
in interface VMPlugin
public Class<?>[] getPluginStaticGroovyMethods()
getPluginStaticGroovyMethods
in interface VMPlugin
public void configureAnnotationNodeFromDefinition(AnnotationNode definition, AnnotationNode root)
configureAnnotationNodeFromDefinition
in interface VMPlugin
public void configureAnnotation(AnnotationNode node)
configureAnnotation
in interface VMPlugin
public void configureClassNode(CompileUnit compileUnit, ClassNode classNode)
configureClassNode
in interface VMPlugin
protected Parameter makeParameter(CompileUnit cu, Type type, Class<?> cl, Annotation[] annotations, String name)
public boolean checkCanSetAccessible(AccessibleObject accessibleObject, Class<?> callerClass)
checkCanSetAccessible
in interface VMPlugin
accessibleObject
- the accessible object to checkcallerClass
- the callerClass to invoke setAccessible
public boolean checkAccessible(Class<?> callerClass, Class<?> declaringClass, int memberModifiers, boolean allowIllegalAccess)
VMPlugin
checkAccessible
in interface VMPlugin
callerClass
- callerClass the callerClass to invoke setAccessible
declaringClass
- the type of member ownermemberModifiers
- modifiers of memberallowIllegalAccess
- whether to allow illegal accesspublic boolean trySetAccessible(AccessibleObject ao)
VMPlugin
accessible
flag for this reflected object to true
if possible.trySetAccessible
in interface VMPlugin
ao
- the accessible objecttrue
if the accessible
flag is set to true
;
false
if access cannot be enabled.public MetaMethod transformMetaMethod(MetaClass metaClass, MetaMethod metaMethod, Class<?> caller)
VMPlugin
transformMetaMethod
in interface VMPlugin
metaClass
- meta classmetaMethod
- the original meta methodcaller
- caller class, whose method sets accessible for methodspublic MetaMethod transformMetaMethod(MetaClass metaClass, MetaMethod metaMethod)
VMPlugin
transformMetaMethod
in interface VMPlugin
metaClass
- meta classmetaMethod
- the original meta methodpublic void invalidateCallSites()
invalidateCallSites
in interface VMPlugin
public Object getInvokeSpecialHandle(Method method, Object receiver)
VMPlugin
getInvokeSpecialHandle
in interface VMPlugin
public Object invokeHandle(Object handle, Object[] args) throws Throwable
VMPlugin
invokeHandle
in interface VMPlugin
handle
- the handleargs
- arguments for the method call, can be empty but not nullThrowable