koala.dynamicjava.tree
Class PackageDeclaration

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

public class PackageDeclaration
extends Declaration

This class represents the package declarations

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

Constructor Summary
PackageDeclaration(ModifierSet mods, java.util.List<IdentifierToken> ident)
          Creates a new package declaration node
PackageDeclaration(ModifierSet mods, java.util.List<IdentifierToken> ident, SourceInfo si)
          Creates a new package declaration node
PackageDeclaration(ModifierSet mods, java.lang.String nm, SourceInfo si)
          Creates a new package declaration node
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 java.lang.String getName()
          Returns the name of the imported class or package
 void setName(java.lang.String s)
          Sets the name
 java.lang.String toString()
          Implementation of toString for use in unit testing
 
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

PackageDeclaration

public PackageDeclaration(ModifierSet mods,
                          java.util.List<IdentifierToken> ident)
Creates a new package declaration node

Parameters:
ident - a list of tokens that represents a package name. The list can be null.

PackageDeclaration

public PackageDeclaration(ModifierSet mods,
                          java.util.List<IdentifierToken> ident,
                          SourceInfo si)
Creates a new package declaration node

Parameters:
ident - a list of tokens that represents a package name. The list can be null.

PackageDeclaration

public PackageDeclaration(ModifierSet mods,
                          java.lang.String nm,
                          SourceInfo si)
Creates a new package declaration node

Parameters:
nm - a string that represents a package name.
Method Detail

getName

public java.lang.String getName()
Returns the name of the imported class or package


setName

public void setName(java.lang.String s)
Sets the 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