@Deprecated(since = "6.0.0", forRemoval = true)
public class Java8
extends Object
implements VMPlugin
Java 8 based functions.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
checkAccessible(Class<?> callerClass, Class<?> declaringClass, int memberModifiers, boolean allowIllegalAccess)* check whether the member can be accessed or not *
|
|
public boolean |
checkCanSetAccessible(AccessibleObject accessibleObject, Class<?> callerClass)The following scenarios can not set accessible, i.e. the return value is false 1) SecurityException occurred 2) the accessible object is a Constructor object for the Class class |
|
public void |
configureAnnotation(AnnotationNode node)* Copies runtime annotation metadata into the supplied annotation node. * *
|
|
public void |
configureClassNode(CompileUnit compileUnit, ClassNode classNode)* Configures the supplied class node from its runtime type information. * *
|
|
public static GenericsType |
configureTypeVariableDefinition(ClassNode base, ClassNode[] bounds)Configures a type-variable definition node from its bounds. |
|
public static ClassNode |
configureTypeVariableReference(String name)Creates a placeholder class node that references a type variable by name. |
|
protected void |
fillParameterNames(String[] names, Member member)Populates parameter names from the supplied reflective executable member. |
|
public Object |
getInvokeSpecialHandle(Method method, Object receiver)* Returns a handle with bound receiver to invokeSpecial the given method. * This method will require at least Java 7, but since the source has to compile * on older Java versions as well it is not marked to return a MethodHandle and * uses Object instead *
|
|
public Class<?>[] |
getPluginDefaultGroovyMethods()* Returns plugin-specific default Groovy methods. * *
|
|
public Class<?>[] |
getPluginStaticGroovyMethods()* Returns plugin-specific static Groovy methods. * *
|
|
protected Expression |
getValue(Field field)Returns the initial expression for given field. |
|
public int |
getVersion()* Gives the version the plugin is made for *
|
|
public void |
invalidateCallSites()* Invalidates cached call sites maintained by the plugin. |
|
public Object |
invokeHandle(Object handle, Object[] arguments)* Invokes a handle produced by #getInvokeSpecialdHandle *
|
|
protected ClassNode |
makeClassNode(CompileUnit cu, Type t, Class<?> c)Creates or reuses a class node for the supplied runtime and generic type information. |
|
protected void |
makeRecordComponents(CompileUnit cu, ClassNode classNode, Class<?> clazz)Adds record components to the class node when supported by the runtime. |
|
protected Lookup |
newLookup(Class<?> targetClass)Creates a lookup capable of accessing members declared by the target class. |
|
public static Lookup |
of(Class<?> targetClass)Returns a private lookup for the supplied target class using the active VM plugin. |
|
public void |
setAdditionalClassInformation(ClassNode cn)* Adds VM-specific metadata to the given class node. * *
|
|
protected AnnotationNode |
toAnnotationNode(Annotation annotation)Converts a runtime annotation instance into a Groovy AST annotation node. |
|
public MetaMethod |
transformMetaMethod(MetaClass metaClass, MetaMethod metaMethod)* transform meta method. * *
|
|
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
*The following scenarios can not set accessible, i.e. the return value is false 1) SecurityException occurred 2) the accessible object is a Constructor object for the Class class
accessibleObject - the accessible object to checkcallerClass - the callerClass to invoke setAccessible* Copies runtime annotation metadata into the supplied annotation node. * *
node - the annotation node to configure* Configures the supplied class node from its runtime type information. * *
unit - the compile unit that owns the class node
*node - the class node to configureConfigures a type-variable definition node from its bounds.
base - the placeholder class nodebounds - the upper bounds of the type variableCreates a placeholder class node that references a type variable by name.
name - the type-variable namePopulates parameter names from the supplied reflective executable member.
names - the destination array for parameter namesmember - the reflective member providing parameter metadata* Returns a handle with bound receiver to invokeSpecial the given method. * This method will require at least Java 7, but since the source has to compile * on older Java versions as well it is not marked to return a MethodHandle and * uses Object instead *
* Returns plugin-specific default Groovy methods. * *
* Returns plugin-specific static Groovy methods. * *
Returns the initial expression for given field.
* Gives the version the plugin is made for *
* Invalidates cached call sites maintained by the plugin.
* Invokes a handle produced by #getInvokeSpecialdHandle *
handle - the handle
*args - arguments for the method call, can be empty but not null
*Creates or reuses a class node for the supplied runtime and generic type information.
cu - the owning compile unitt - the reflective typec - the erased runtime classAdds record components to the class node when supported by the runtime.
cu - the owning compile unitclassNode - the class node to updateclazz - the runtime classCreates a lookup capable of accessing members declared by the target class.
targetClass - the lookup targetReturns a private lookup for the supplied target class using the active VM plugin.
targetClass - the class to create a lookup fortargetClass* Adds VM-specific metadata to the given class node. * *
node - the class node to enrichConverts a runtime annotation instance into a Groovy AST annotation node.
annotation - the runtime annotation* transform meta method. * *
metaClass - metaclass
*metaMethod - the original meta method
** 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.
*