koala.dynamicjava.tree
Class Node

java.lang.Object
  extended by koala.dynamicjava.tree.Node
All Implemented Interfaces:
SourceInfo.Wrapper
Direct Known Subclasses:
CompilationUnit, Declaration, Expression, ImportDeclaration, Initializer, ModifierSet, Statement, SwitchBlock, TypeName

public abstract class Node
extends Object
implements SourceInfo.Wrapper

This class represents the nodes of the syntax tree

Version:
1.1 - 1999/11/12
Author:
Stephane Hillion

Constructor Summary
protected Node(SourceInfo si)
           
 
Method Summary
abstract
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 void archiveProperties(String prefix)
          Change the names of all properties by prefixing each name with the given string.
 Set<String> getProperties()
          Returns the defined properties for this node.
 Object getProperty(String name)
          Returns the value of a property
 SourceInfo getSourceInfo()
          Returns the sourceInfo.
 boolean hasProperty(String name)
          Returns true if a property is defined for this node
 void setProperty(String name, Object value)
          Sets the value of a property
 void setSourceInfo(SourceInfo si)
          Sets the filename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

protected Node(SourceInfo si)
Method Detail

getSourceInfo

public SourceInfo getSourceInfo()
Returns the sourceInfo.

Specified by:
getSourceInfo in interface SourceInfo.Wrapper

setSourceInfo

public void setSourceInfo(SourceInfo si)
Sets the filename


setProperty

public void setProperty(String name,
                        Object value)
Sets the value of a property

Parameters:
name - the property name
value - the new value to set

getProperty

public Object getProperty(String name)
Returns the value of a property

Parameters:
name - the property name
Returns:
null if the property was not previously set

getProperties

public Set<String> getProperties()
Returns the defined properties for this node.

Returns:
a set of string

hasProperty

public boolean hasProperty(String name)
Returns true if a property is defined for this node

Parameters:
name - the name of the property

archiveProperties

public void archiveProperties(String prefix)
Change the names of all properties by prefixing each name with the given string.


acceptVisitor

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

Parameters:
visitor - the visitor to accept