koala.dynamicjava.tree
Class ClassDeclaration

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Declaration
          extended by koala.dynamicjava.tree.TypeDeclaration
              extended by koala.dynamicjava.tree.ClassDeclaration
All Implemented Interfaces:
SourceInfo.Wrapper
Direct Known Subclasses:
EnumDeclaration

public class ClassDeclaration
extends TypeDeclaration

This class represents a class declaration

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

Constructor Summary
ClassDeclaration(ModifierSet mods, java.lang.String name, Option<java.util.List<TypeParameter>> tparams, ReferenceTypeName ext, java.util.List<? extends ReferenceTypeName> impl, java.util.List<Node> body)
          Creates a new class declaration
ClassDeclaration(ModifierSet mods, java.lang.String name, Option<java.util.List<TypeParameter>> tparams, ReferenceTypeName ext, java.util.List<? extends ReferenceTypeName> impl, java.util.List<Node> body, SourceInfo si)
          Creates a new class declaration
ClassDeclaration(ModifierSet mods, java.lang.String name, ReferenceTypeName ext, java.util.List<? extends ReferenceTypeName> impl, java.util.List<Node> body)
          Creates a new class declaration
ClassDeclaration(ModifierSet mods, java.lang.String name, ReferenceTypeName ext, java.util.List<? extends ReferenceTypeName> impl, java.util.List<Node> body, SourceInfo si)
          Creates a new class declaration
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 ReferenceTypeName getSuperclass()
          Returns the name of the superclass of this class
 void setSuperclass(ReferenceTypeName s)
          Sets the superclass name
 java.lang.String toString()
          Implementation of toString for use in unit testing
protected  java.lang.String toStringHelper()
           
 
Methods inherited from class koala.dynamicjava.tree.TypeDeclaration
getInterfaces, getMembers, getName, getTypeParams, setInterfaces, setMembers, setName, setTypeArgs, setTypeArgs
 
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

ClassDeclaration

public ClassDeclaration(ModifierSet mods,
                        java.lang.String name,
                        ReferenceTypeName ext,
                        java.util.List<? extends ReferenceTypeName> impl,
                        java.util.List<Node> body)
Creates a new class declaration

Parameters:
mods - the modifiers
name - the name of the class to declare
ext - the tokens that compose the name of the parent class. The list can be null. The superclass property is then set to "java.lang.Object".
impl - the list of implemented interfaces (a list of list of Token). Can be null.
body - the list of members declarations

ClassDeclaration

public ClassDeclaration(ModifierSet mods,
                        java.lang.String name,
                        Option<java.util.List<TypeParameter>> tparams,
                        ReferenceTypeName ext,
                        java.util.List<? extends ReferenceTypeName> impl,
                        java.util.List<Node> body)
Creates a new class declaration

Parameters:
mods - the modifiers
name - the name of the class to declare
tparams - the type parameters
ext - the tokens that compose the name of the parent class. The list can be null. The superclass property is then set to "java.lang.Object".
impl - the list of implemented interfaces (a list of list of Token). Can be null.
body - the list of members declarations

ClassDeclaration

public ClassDeclaration(ModifierSet mods,
                        java.lang.String name,
                        ReferenceTypeName ext,
                        java.util.List<? extends ReferenceTypeName> impl,
                        java.util.List<Node> body,
                        SourceInfo si)
Creates a new class declaration

Parameters:
mods - the modifiers
name - the name of the class to declare
ext - the tokens that compose the name of the parent class. The list can be null. The superclass property is then set to "java.lang.Object".
impl - the list of implemented interfaces (a list of list of Token). Can be null.
body - the list of members declarations

ClassDeclaration

public ClassDeclaration(ModifierSet mods,
                        java.lang.String name,
                        Option<java.util.List<TypeParameter>> tparams,
                        ReferenceTypeName ext,
                        java.util.List<? extends ReferenceTypeName> impl,
                        java.util.List<Node> body,
                        SourceInfo si)
Creates a new class declaration

Parameters:
mods - the modifiers
name - the name of the class to declare
tparams - the type parameters
ext - the tokens that compose the name of the parent class. The list can be null. The superclass property is then set to "java.lang.Object".
impl - the list of implemented interfaces (a list of list of Token). Can be null.
body - the list of members declarations
Method Detail

getSuperclass

public ReferenceTypeName getSuperclass()
Returns the name of the superclass of this class


setSuperclass

public void setSuperclass(ReferenceTypeName s)
Sets the superclass name

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

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

protected java.lang.String toStringHelper()