|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.ast.ASTNode org.codehaus.groovy.ast.AnnotatedNode org.codehaus.groovy.ast.MethodNode
public class MethodNode extends AnnotatedNode
Represents a method declaration
Constructor Summary | |
MethodNode(java.lang.String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code)
|
Method Summary | |
---|---|
Statement
|
getCode()
|
ClassNode[]
|
getExceptions()
|
Statement
|
getFirstStatement()
|
GenericsType[]
|
getGenericsTypes()
|
int
|
getModifiers()
|
java.lang.String
|
getName()
|
Parameter[]
|
getParameters()
|
ClassNode
|
getReturnType()
|
java.lang.String
|
getText()
Provides a nicely formatted string of the method definition. |
java.lang.String
|
getTypeDescriptor()
The type descriptor for a method node is a string containing the name of the method, its return type, and its parameter types in a canonical form. |
VariableScope
|
getVariableScope()
|
boolean
|
hasAnnotationDefault()
|
boolean
|
hasDefaultValue()
|
boolean
|
isAbstract()
|
boolean
|
isDynamicReturnType()
|
boolean
|
isFinal()
|
boolean
|
isPrivate()
|
boolean
|
isProtected()
|
boolean
|
isPublic()
|
boolean
|
isScriptBody()
@return true if this method is the run method from a script |
boolean
|
isStatic()
|
boolean
|
isStaticConstructor()
|
boolean
|
isSyntheticPublic()
Indicates that this method has been "promoted" to public by Groovy when in fact there was no public modifier explicitly in the source code. |
boolean
|
isVoidMethod()
|
void
|
setAnnotationDefault(boolean b)
|
void
|
setCode(Statement code)
|
void
|
setGenericsTypes(GenericsType[] genericsTypes)
|
void
|
setModifiers(int modifiers)
|
void
|
setParameters(Parameter[] parameters)
|
void
|
setReturnType(ClassNode returnType)
|
void
|
setSyntheticPublic(boolean syntheticPublic)
|
void
|
setVariableScope(VariableScope variableScope)
|
java.lang.String
|
toString()
|
Methods inherited from class AnnotatedNode | |
---|---|
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public MethodNode(java.lang.String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code)
Method Detail |
---|
public Statement getCode()
public ClassNode[] getExceptions()
public Statement getFirstStatement()
public GenericsType[] getGenericsTypes()
public int getModifiers()
public java.lang.String getName()
public Parameter[] getParameters()
public ClassNode getReturnType()
String retType = AstToTextHelper.getClassText(returnType); public java.lang.String getText()
public java.lang.String getTypeDescriptor()
public VariableScope getVariableScope()
public boolean hasAnnotationDefault()
public boolean hasDefaultValue()
public boolean isAbstract()
public boolean isDynamicReturnType()
public boolean isFinal()
public boolean isPrivate()
public boolean isProtected()
public boolean isPublic()
public boolean isScriptBody()
public boolean isStatic()
public boolean isStaticConstructor()
public boolean isSyntheticPublic()
public boolean isVoidMethod()
public void setAnnotationDefault(boolean b)
public void setCode(Statement code)
public void setGenericsTypes(GenericsType[] genericsTypes)
public void setModifiers(int modifiers)
public void setParameters(Parameter[] parameters)
public void setReturnType(ClassNode returnType)
public void setSyntheticPublic(boolean syntheticPublic)
public void setVariableScope(VariableScope variableScope)
public java.lang.String toString()
Groovy Documentation