koala.dynamicjava.tree
Class ConstructorDeclaration

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Declaration
          extended by koala.dynamicjava.tree.ConstructorDeclaration
All Implemented Interfaces:
SourceInfo.Wrapper

public class ConstructorDeclaration
extends Declaration

This class represents constructor declarations in an AST

Version:
1.0 - 1999/05/23
Author:
Stephane Hillion

Constructor Summary
ConstructorDeclaration(ModifierSet mods, Option<java.util.List<TypeParameter>> tparams, java.lang.String name, java.util.List<FormalParameter> params, java.util.List<? extends ReferenceTypeName> excepts, ConstructorCall eci, java.util.List<Node> stmts)
          Creates a new method declaration
ConstructorDeclaration(ModifierSet mods, Option<java.util.List<TypeParameter>> tparams, java.lang.String name, java.util.List<FormalParameter> params, java.util.List<? extends ReferenceTypeName> excepts, ConstructorCall eci, java.util.List<Node> stmts, SourceInfo si)
          Creates a new method declaration
ConstructorDeclaration(ModifierSet mods, java.lang.String name, java.util.List<FormalParameter> params, java.util.List<? extends ReferenceTypeName> excepts, ConstructorCall eci, java.util.List<Node> stmts)
          Creates a new method declaration
ConstructorDeclaration(ModifierSet mods, java.lang.String name, java.util.List<FormalParameter> params, java.util.List<? extends ReferenceTypeName> excepts, ConstructorCall eci, java.util.List<Node> stmts, SourceInfo si)
          Creates a new method declaration
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 ConstructorCall getConstructorCall()
          The explicit constructor invocation if one or null
 java.util.List<? extends ReferenceTypeName> getExceptions()
          Returns the list of the exception thrown by this method
 java.lang.String getName()
          Returns the name of this constructor
 java.util.List<FormalParameter> getParameters()
          Returns the parameters list
 java.util.List<Node> getStatements()
          Returns the statements
 Option<java.util.List<TypeParameter>> getTypeParams()
           
 boolean isVarArgs()
           
 void setConstructorCall(ConstructorCall ci)
          Sets the constructor invocation
 void setExceptions(java.util.List<? extends ReferenceTypeName> l)
          Sets the exceptions thrown by this method
 void setName(java.lang.String s)
          Sets the constructor's name
 void setParameters(java.util.List<FormalParameter> l)
          Sets the parameters
 void setStatements(java.util.List<Node> l)
          Sets the statements
 void setTypeArgs(java.util.List<TypeParameter> tparams)
           
 void setTypeArgs(Option<java.util.List<TypeParameter>> tparams)
           
 java.lang.String toString()
          Implementation of toString for use in unit testing
 java.lang.String toStringHelper()
           
 
Methods inherited from class koala.dynamicjava.tree.Declaration
getModifiers, setModifiers
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructorDeclaration

public ConstructorDeclaration(ModifierSet mods,
                              java.lang.String name,
                              java.util.List<FormalParameter> params,
                              java.util.List<? extends ReferenceTypeName> excepts,
                              ConstructorCall eci,
                              java.util.List<Node> stmts)
Creates a new method declaration

Parameters:
mods - the modifiers
name - the name of this constructor
params - the parameters list
excepts - the exception list (a list of list of token)
eci - the explicit constructor invocation
stmts - the statements
Throws:
java.lang.IllegalArgumentException - if name is null or params is null or excepts is null or stmts is null

ConstructorDeclaration

public ConstructorDeclaration(ModifierSet mods,
                              Option<java.util.List<TypeParameter>> tparams,
                              java.lang.String name,
                              java.util.List<FormalParameter> params,
                              java.util.List<? extends ReferenceTypeName> excepts,
                              ConstructorCall eci,
                              java.util.List<Node> stmts)
Creates a new method declaration

Parameters:
mods - the modifiers
tparams - the type parameters
name - the name of this constructor
params - the parameters list
excepts - the exception list (a list of list of token)
eci - the explicit constructor invocation
stmts - the statements
Throws:
java.lang.IllegalArgumentException - if name is null or params is null or excepts is null or stmts is null

ConstructorDeclaration

public ConstructorDeclaration(ModifierSet mods,
                              java.lang.String name,
                              java.util.List<FormalParameter> params,
                              java.util.List<? extends ReferenceTypeName> excepts,
                              ConstructorCall eci,
                              java.util.List<Node> stmts,
                              SourceInfo si)
Creates a new method declaration

Parameters:
mods - the modifiers
name - the name of this constructor
params - the parameters list
excepts - the exception list (a list of list of token)
eci - the explicit constructor invocation
stmts - the statements
Throws:
java.lang.IllegalArgumentException - if name is null or params is null or excepts is null or stmts is null

ConstructorDeclaration

public ConstructorDeclaration(ModifierSet mods,
                              Option<java.util.List<TypeParameter>> tparams,
                              java.lang.String name,
                              java.util.List<FormalParameter> params,
                              java.util.List<? extends ReferenceTypeName> excepts,
                              ConstructorCall eci,
                              java.util.List<Node> stmts,
                              SourceInfo si)
Creates a new method declaration

Parameters:
mods - the modifiers
tparams - the type parameters
name - the name of this constructor
params - the parameters list
excepts - the exception list (a list of list of token)
eci - the explicit constructor invocation
stmts - the statements
Throws:
java.lang.IllegalArgumentException - if name is null or params is null or excepts is null or stmts is null
Method Detail

getTypeParams

public Option<java.util.List<TypeParameter>> getTypeParams()

setTypeArgs

public void setTypeArgs(java.util.List<TypeParameter> tparams)

setTypeArgs

public void setTypeArgs(Option<java.util.List<TypeParameter>> tparams)

getName

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


setName

public void setName(java.lang.String s)
Sets the constructor's name

Throws:
java.lang.IllegalArgumentException - if s is null

getParameters

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


setParameters

public void setParameters(java.util.List<FormalParameter> l)
Sets the parameters


getExceptions

public java.util.List<? extends ReferenceTypeName> getExceptions()
Returns the list of the exception thrown by this method

Returns:
a list of string

setExceptions

public void setExceptions(java.util.List<? extends ReferenceTypeName> l)
Sets the exceptions thrown by this method

Throws:
java.lang.IllegalArgumentException - if l is null

getConstructorCall

public ConstructorCall getConstructorCall()
The explicit constructor invocation if one or null


setConstructorCall

public void setConstructorCall(ConstructorCall ci)
Sets the constructor invocation


getStatements

public java.util.List<Node> getStatements()
Returns the statements


setStatements

public void setStatements(java.util.List<Node> l)
Sets the statements

Throws:
java.lang.IllegalArgumentException - if l is null

isVarArgs

public boolean isVarArgs()

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

public java.lang.String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class java.lang.Object

toStringHelper

public java.lang.String toStringHelper()