org.codehaus.groovy.ast
Class MethodNode

Represents a method declaration

author:
James Strachan
version:
$Revision: 11961 $

Field Summary
 Statement code
           
 boolean dynamicReturnType
           
 def exceptions
           
 def genericsTypes
           
 boolean hasDefaultValue
           
 int modifiers
           
 String name
           
 def parameters
           
 ClassNode returnType
           
 VariableScope variableScope
           
 
Constructor Summary
MethodNode(String name, int modifiers, ClassNode returnType, def parameters, def exceptions, Statement code)
           
 
Method Summary
Statement getCode()
          
def getExceptions()
          
Statement getFirstStatement()
          
def getGenericsTypes()
          
int getModifiers()
          
String getName()
          
def getParameters()
          
ClassNode getReturnType()
          
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 hasDefaultValue()
          
boolean isAbstract()
          
boolean isDynamicReturnType()
          
boolean isProtected()
          
boolean isPublic()
          
boolean isStatic()
          
boolean isVoidMethod()
          
void setCode(Statement code)
          
void setGenericsTypes(def genericsTypes)
          
void setModifiers(int modifiers)
          
void setParameters(def parameters)
          
void setReturnType(ClassNode returnType)
          
void setVariableScope(VariableScope variableScope)
          
String toString()
          
 

Constructor Detail

MethodNode

public MethodNode(String name, int modifiers, ClassNode returnType, def parameters, def exceptions, Statement code)


Method Detail

getCode

public Statement getCode()


getExceptions

public def getExceptions()


getFirstStatement

public Statement getFirstStatement()


getGenericsTypes

public def getGenericsTypes()


getModifiers

public int getModifiers()


getName

public String getName()


getParameters

public def getParameters()


getReturnType

public ClassNode getReturnType()


getTypeDescriptor

public 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. For simplicity, I'm using the format of a Java declaration without parameter names, and with $dynamic as the type for any dynamically typed values.


getVariableScope

public VariableScope getVariableScope()


hasDefaultValue

public boolean hasDefaultValue()


isAbstract

public boolean isAbstract()


isDynamicReturnType

public boolean isDynamicReturnType()


isProtected

public boolean isProtected()


isPublic

public boolean isPublic()


isStatic

public boolean isStatic()


isVoidMethod

public boolean isVoidMethod()


setCode

public void setCode(Statement code)


setGenericsTypes

public void setGenericsTypes(def genericsTypes)


setModifiers

public void setModifiers(int modifiers)


setParameters

public void setParameters(def parameters)


setReturnType

public void setReturnType(ClassNode returnType)


setVariableScope

public void setVariableScope(VariableScope variableScope)


toString

public String toString()