koala.dynamicjava.tree
Class MethodDeclaration

java.lang.Object
  |
  +--koala.dynamicjava.tree.Node
        |
        +--koala.dynamicjava.tree.MethodDeclaration

public class MethodDeclaration
extends Node

This class represents method declarations in an AST


Field Summary
static java.lang.String ACCESS_FLAGS
          The accessFlags property name
static java.lang.String BODY
          The body property name
static java.lang.String EXCEPTIONS
          The exceptions property name
static java.lang.String NAME
          The name property name
static java.lang.String PARAMETERS
          The parameters property name
static java.lang.String RETURN_TYPE
          The type property name
 
Fields inherited from class koala.dynamicjava.tree.Node
BEGIN_COLUMN, BEGIN_LINE, END_COLUMN, END_LINE, FILENAME
 
Constructor Summary
MethodDeclaration(int flags, Type type, java.lang.String name, java.util.List params, java.util.List excepts, BlockStatement body)
          Creates a new method declaration
MethodDeclaration(int flags, Type type, java.lang.String name, java.util.List params, java.util.List excepts, BlockStatement body, java.lang.String fn, int bl, int bc, int el, int ec)
          Creates a new method declaration
 
Method Summary
 java.lang.Object acceptVisitor(Visitor visitor)
          Allows a visitor to traverse the tree
 int getAccessFlags()
          Returns the access flags for this method
 BlockStatement getBody()
          Returns the body of the method, null if the method is abstract
 java.util.List getExceptions()
          Returns the list of the exception thrown by this method
 java.lang.String getName()
          Returns the name of this method
 java.util.List getParameters()
          Returns the parameters list
 Type getReturnType()
          Gets the return type of this method
 void setAccessFlags(int f)
          Sets the access flags for this constructor
 void setBody(BlockStatement bs)
          Sets the body
 void setExceptions(java.util.List l)
          Sets the exceptions list
 void setName(java.lang.String s)
          Sets the method's name
 void setParameters(java.util.List l)
          Sets the parameters list
 void setReturnType(Type t)
          Sets the return type of this method
 
Methods inherited from class koala.dynamicjava.tree.Node
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getFilename, getProperties, getProperty, hasProperty, removePropertyChangeListener, removePropertyChangeListener, setBeginColumn, setBeginLine, setEndColumn, setEndLine, setFilename, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCESS_FLAGS

public static final java.lang.String ACCESS_FLAGS
The accessFlags property name

RETURN_TYPE

public static final java.lang.String RETURN_TYPE
The type property name

NAME

public static final java.lang.String NAME
The name property name

PARAMETERS

public static final java.lang.String PARAMETERS
The parameters property name

EXCEPTIONS

public static final java.lang.String EXCEPTIONS
The exceptions property name

BODY

public static final java.lang.String BODY
The body property name
Constructor Detail

MethodDeclaration

public MethodDeclaration(int flags,
                         Type type,
                         java.lang.String name,
                         java.util.List params,
                         java.util.List excepts,
                         BlockStatement body)
Creates a new method declaration
Parameters:
flags - the access flags
type - the return type of this method
name - the name of the method to declare
params - the parameters list
excepts - the exception list
body - the body statement
Throws:
java.lang.IllegalArgumentException - if name is null or type is null or params is null or excepts is null

MethodDeclaration

public MethodDeclaration(int flags,
                         Type type,
                         java.lang.String name,
                         java.util.List params,
                         java.util.List excepts,
                         BlockStatement body,
                         java.lang.String fn,
                         int bl,
                         int bc,
                         int el,
                         int ec)
Creates a new method declaration
Parameters:
flags - the access flags
type - the return type of this method
name - the name of the method to declare
params - the parameters list
excepts - the exception list
body - the body statement
fn - the filename
bl - the begin line
bc - the begin column
el - the end line
ec - the end column
Throws:
java.lang.IllegalArgumentException - if name is null or type is null or params is null or excepts is null
Method Detail

getAccessFlags

public int getAccessFlags()
Returns the access flags for this method

setAccessFlags

public void setAccessFlags(int f)
Sets the access flags for this constructor

getReturnType

public Type getReturnType()
Gets the return type of this method

setReturnType

public void setReturnType(Type t)
Sets the return type of this method
Throws:
java.lang.IllegalArgumentException - if t is null

getName

public java.lang.String getName()
Returns the name of this method

setName

public void setName(java.lang.String s)
Sets the method's name
Throws:
java.lang.IllegalArgumentException - if s is null

getParameters

public java.util.List getParameters()
Returns the parameters list

setParameters

public void setParameters(java.util.List l)
Sets the parameters list
Throws:
java.lang.IllegalArgumentException - if l is null

getExceptions

public java.util.List getExceptions()
Returns the list of the exception thrown by this method
Returns:
a list of string

setExceptions

public void setExceptions(java.util.List l)
Sets the exceptions list
Throws:
java.lang.IllegalArgumentException - if l is null

getBody

public BlockStatement getBody()
Returns the body of the method, null if the method is abstract

setBody

public void setBody(BlockStatement bs)
Sets the body

acceptVisitor

public java.lang.Object acceptVisitor(Visitor visitor)
Allows a visitor to traverse the tree
Overrides:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept


Copyright © 2001 Stephane Hillion. All Rights Reserved.