|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Field Summary | |
---|---|
def |
EMPTY_ARRAY
|
ClassNode |
SUPER
|
ClassNode |
THIS
|
boolean |
annotated
|
Class |
clazz
|
CompileUnit |
compileUnit
|
ClassNode |
componentType
|
List |
constructors
|
MethodNode |
enclosingMethod
|
Map |
fieldIndex
|
List |
fields
|
def |
genericsTypes
|
def |
interfaces
|
boolean |
isPrimaryNode
|
boolean |
lazyInitDone
|
Object |
lazyInitLock
|
Map |
map
|
MapOfLists |
methods
|
List |
methodsList
|
def |
mixins
|
int |
modifiers
|
ModuleNode |
module
|
String |
name
|
List |
objectInitializers
|
boolean |
placeholder
|
List |
properties
|
ClassNode |
redirect
|
boolean |
script
|
boolean |
scriptBody
|
boolean |
staticClass
|
ClassNode |
superClass
|
boolean |
usesGenerics
|
Constructor Summary | |
MapOfLists()
|
Method Summary | |
---|---|
def |
ClassNode(ClassNode componentType)
Constructor used by makeArray() if no real class is available |
def |
ClassNode(Class c, ClassNode componentType)
Constructor used by makeArray() if a real class is available |
def |
ClassNode(Class c)
Creates a ClassNode from a real class. |
def |
ClassNode(String name, int modifiers, ClassNode superClass)
base class |
def |
ClassNode(String name, int modifiers, ClassNode superClass, def interfaces, def mixins)
base class |
void |
addConstructor(ConstructorNode node)
|
ConstructorNode |
addConstructor(int modifiers, def parameters, def exceptions, Statement code)
|
void |
addField(FieldNode node)
|
FieldNode |
addField(String name, int modifiers, ClassNode type, Expression initialValue)
|
void |
addInterface(ClassNode type)
|
void |
addMethod(MethodNode node)
|
MethodNode |
addMethod(String name, int modifiers, ClassNode returnType, def parameters, def exceptions, Statement code)
If a method with the given name and parameters is already defined then it is returned otherwise the given method is added to this node. |
void |
addMixin(MixinNode mixin)
|
void |
addObjectInitializerStatements(Statement statements)
|
void |
addProperty(PropertyNode node)
|
PropertyNode |
addProperty(String name, int modifiers, ClassNode type, Expression initialValueExpression, Statement getterBlock, Statement setterBlock)
|
void |
addStaticInitializerStatements(List staticStatements, boolean fieldInit)
|
MethodNode |
addSyntheticMethod(String name, int modifiers, ClassNode returnType, def parameters, def exceptions, Statement code)
Adds a synthetic method as part of the compilation process |
boolean |
declaresInterface(ClassNode classNode)
or if one of its interfaces extends directly or indirectly the interface |
boolean |
declaresInterfaceDirect(def interfaces, ClassNode classNode)
|
boolean |
equals(Object o)
|
List |
get(Object key)
|
List |
getAbstractMethods()
Returns a list containing MethodNode objects for each abstract method in the class represented by this ClassNode |
List |
getAllDeclaredMethods()
|
CompileUnit |
getCompileUnit()
|
ClassNode |
getComponentType()
|
List |
getDeclaredConstructors()
|
FieldNode |
getDeclaredField(String name)
Finds a field matching the given name in this class. |
MethodNode |
getDeclaredMethod(String name, def parameters)
Finds a method matching the given name and parameters in this class. |
List |
getDeclaredMethods(String name)
This methods returns a list of all methods of the given name defined in the current class |
Map |
getDeclaredMethodsMap()
|
MethodNode |
getEnclosingMethod()
|
FieldNode |
getField(String name)
Finds a field matching the given name in this class or a parent class. |
List |
getFields()
Returns a list containing FieldNode objects for each field in the class represented by this ClassNode |
def |
getGenericsTypes()
|
MethodNode |
getGetterMethod(String getterName)
|
def |
getInterfaces()
Returns an array of ClassNodes representing the interfaces the class implements |
MethodNode |
getMethod(String name, def parameters)
Finds a method matching the given name and parameters in this class or any parent class. |
List |
getMethods()
Returns a list containing MethodNode objects for each method in the class represented by this ClassNode |
List |
getMethods(String name)
This methods creates a list of all methods with this name of the current class and of all super classes |
def |
getMixins()
|
int |
getModifiers()
|
ModuleNode |
getModule()
|
String |
getName()
|
String |
getNameWithoutPackage()
|
List |
getNotNull(Object key)
|
List |
getObjectInitializerStatements()
|
ClassNode |
getOuterClass()
Helper method to avoid casting to inner class |
FieldNode |
getOuterField(String name)
inner class |
String |
getPackageName()
|
ClassNode |
getPlainNodeReference()
|
List |
getProperties()
|
PropertyNode |
getProperty(String name)
|
MethodNode |
getSetterMethod(String setterName)
|
ClassNode |
getSuperClass()
|
Class |
getTypeClass()
|
ClassNode |
getUnresolvedSuperClass()
|
ClassNode |
getUnresolvedSuperClass(boolean useRedirect)
|
boolean |
hasDeclaredMethod(String name, def parameters)
|
boolean |
hasMethod(String name, def parameters)
|
boolean |
hasPackageName()
|
boolean |
hasPossibleMethod(String name, Expression arguments)
Returns true if the given method has a possibly matching method with the given name and arguments |
boolean |
hasPossibleStaticMethod(String name, Expression arguments)
Returns true if the given method has a possibly matching static method with the given name and arguments |
boolean |
hasProperty(String name)
|
boolean |
implementsInterface(ClassNode classNode)
|
boolean |
isAnnotated()
|
boolean |
isArray()
|
boolean |
isDerivedFrom(ClassNode type)
|
boolean |
isDerivedFromGroovyObject()
i.e. it implements GroovyObject |
boolean |
isGenericsPlaceHolder()
|
boolean |
isInterface()
|
boolean |
isPrimaryClassNode()
Returns if this instance is a primary ClassNode |
boolean |
isResolved()
|
boolean |
isScript()
|
boolean |
isScriptBody()
|
boolean |
isStaticClass()
Is this class delcared in a static method (such as a closure / inner class declared in a static method) |
boolean |
isUsingGenerics()
|
void |
lazyClassInit()
The complete class structure will be initialized only when really needed to avoid having too much objects during compilation |
ClassNode |
makeArray()
Returns a ClassNode representing an array of the class represented by this ClassNode |
boolean |
parametersEqual(def a, def b)
|
void |
put(Object key, Object value)
|
ClassNode |
redirect()
Returns the ClassNode this ClassNode is redirecting to. |
void |
setAnnotated(boolean flag)
Marks if the current class uses annotations or not |
void |
setCompileUnit(CompileUnit cu)
|
void |
setEnclosingMethod(MethodNode enclosingMethod)
|
void |
setGenericsPlaceHolder(boolean b)
|
void |
setGenericsTypes(def genericsTypes)
|
void |
setInterfaces(def interfaces)
|
void |
setModule(ModuleNode module)
|
String |
setName(String name)
|
void |
setRedirect(ClassNode cn)
Sets this instance as proxy for the given ClassNode. |
void |
setScript(boolean script)
|
void |
setScriptBody(boolean scriptBody)
|
void |
setStaticClass(boolean staticClass)
|
void |
setSuperClass(ClassNode superClass)
Sets the superclass of this ClassNode |
void |
setUnresolvedSuperClass(ClassNode sn)
|
void |
setUsingGenerics(boolean b)
|
String |
toString()
|
void |
visitContents(GroovyClassVisitor visitor)
|
Constructor Detail |
---|
MapOfLists()
Method Detail |
---|
def ClassNode(ClassNode componentType)
def ClassNode(Class c, ClassNode componentType)
public def ClassNode(Class c)
public def ClassNode(String name, int modifiers, ClassNode superClass)
public def ClassNode(String name, int modifiers, ClassNode superClass, def interfaces, def mixins)
public void addConstructor(ConstructorNode node)
public ConstructorNode addConstructor(int modifiers, def parameters, def exceptions, Statement code)
public void addField(FieldNode node)
public FieldNode addField(String name, int modifiers, ClassNode type, Expression initialValue)
public void addInterface(ClassNode type)
public void addMethod(MethodNode node)
public MethodNode addMethod(String name, int modifiers, ClassNode returnType, def parameters, def exceptions, Statement code)
public void addMixin(MixinNode mixin)
public void addObjectInitializerStatements(Statement statements)
public void addProperty(PropertyNode node)
public PropertyNode addProperty(String name, int modifiers, ClassNode type, Expression initialValueExpression, Statement getterBlock, Statement setterBlock)
public void addStaticInitializerStatements(List staticStatements, boolean fieldInit)
public MethodNode addSyntheticMethod(String name, int modifiers, ClassNode returnType, def parameters, def exceptions, Statement code)
public boolean declaresInterface(ClassNode classNode)
boolean declaresInterfaceDirect(def interfaces, ClassNode classNode)
public boolean equals(Object o)
public List get(Object key)
public List getAbstractMethods()
public List getAllDeclaredMethods()
public CompileUnit getCompileUnit()
public ClassNode getComponentType()
public List getDeclaredConstructors()
public FieldNode getDeclaredField(String name)
public MethodNode getDeclaredMethod(String name, def parameters)
public List getDeclaredMethods(String name)
Map getDeclaredMethodsMap()
public MethodNode getEnclosingMethod()
public FieldNode getField(String name)
public List getFields()
public def getGenericsTypes()
public MethodNode getGetterMethod(String getterName)
public def getInterfaces()
public MethodNode getMethod(String name, def parameters)
public List getMethods()
public List getMethods(String name)
public def getMixins()
public int getModifiers()
public ModuleNode getModule()
public String getName()
public String getNameWithoutPackage()
public List getNotNull(Object key)
public List getObjectInitializerStatements()
public ClassNode getOuterClass()
public FieldNode getOuterField(String name)
public String getPackageName()
public ClassNode getPlainNodeReference()
public List getProperties()
public PropertyNode getProperty(String name)
public MethodNode getSetterMethod(String setterName)
public ClassNode getSuperClass()
public Class getTypeClass()
public ClassNode getUnresolvedSuperClass()
public ClassNode getUnresolvedSuperClass(boolean useRedirect)
public boolean hasDeclaredMethod(String name, def parameters)
public boolean hasMethod(String name, def parameters)
public boolean hasPackageName()
public boolean hasPossibleMethod(String name, Expression arguments)
public boolean hasPossibleStaticMethod(String name, Expression arguments)
public boolean hasProperty(String name)
public boolean implementsInterface(ClassNode classNode)
public boolean isAnnotated()
public boolean isArray()
public boolean isDerivedFrom(ClassNode type)
public boolean isDerivedFromGroovyObject()
public boolean isGenericsPlaceHolder()
public boolean isInterface()
public boolean isPrimaryClassNode()
public boolean isResolved()
public boolean isScript()
public boolean isScriptBody()
public boolean isStaticClass()
public boolean isUsingGenerics()
void lazyClassInit()
public ClassNode makeArray()
boolean parametersEqual(def a, def b)
public void put(Object key, Object value)
public ClassNode redirect()
public void setAnnotated(boolean flag)
void setCompileUnit(CompileUnit cu)
public void setEnclosingMethod(MethodNode enclosingMethod)
public void setGenericsPlaceHolder(boolean b)
public void setGenericsTypes(def genericsTypes)
public void setInterfaces(def interfaces)
public void setModule(ModuleNode module)
public String setName(String name)
public void setRedirect(ClassNode cn)
public void setScript(boolean script)
public void setScriptBody(boolean scriptBody)
public void setStaticClass(boolean staticClass)
public void setSuperClass(ClassNode superClass)
public void setUnresolvedSuperClass(ClassNode sn)
public void setUsingGenerics(boolean b)
public String toString()
public void visitContents(GroovyClassVisitor visitor)