org.objectweb.fractal.adl
Interface Node

All Known Implementing Classes:
AbstractNode

public interface Node

An Abstract Syntax Tree (AST) node. Each node has a type (which can be though of as the tag of an XML element), and can have attributes as well as sub nodes (which can be though of as XML attributes and XML sub elements).


Method Summary
 void astAddNode(Node node)
          Adds a sub node to this node.
 Map astGetAttributes()
          Returns the attributes of this node.
 Object astGetDecoration(String name)
          Returns a decoration of this node.
 Map astGetDecorations()
          Returns the decorations of this node.
 Node[] astGetNodes(String type)
          Returns the sub nodes of this node that are of the given type.
 String[] astGetNodeTypes()
          Returns the types of the sub nodes that this node can have.
 String astGetSource()
          Returns the source of this node.
 String astGetType()
          Returns the type of this node.
 Node astNewInstance()
          Creates a new, empty AST node of the same type as this node.
 void astRemoveNode(Node node)
          Removes a sub node from this node.
 void astSetAttributes(Map attributes)
          Sets the attributes of this node.
 void astSetDecoration(String name, Object decoration)
          Sets a decoration of this node.
 void astSetDecorations(Map decorations)
          Sets the decorations of this node.
 void astSetSource(String source)
          Sets the source of this node.
 

Method Detail

astGetType

public String astGetType()
Returns the type of this node.

Returns:
the type of this node.

astGetSource

public String astGetSource()
Returns the source of this node.

Returns:
the source of this node (such as a file name).

astSetSource

public void astSetSource(String source)
Sets the source of this node.

Parameters:
source - the source of this node (such as a file name).

astGetAttributes

public Map astGetAttributes()
Returns the attributes of this node.

Returns:
the attributes of this node.

astSetAttributes

public void astSetAttributes(Map attributes)
Sets the attributes of this node.

Parameters:
attributes - the attributes of this node that must be changed (attributes that are not defined in this argument are left unchanged).

astGetDecoration

public Object astGetDecoration(String name)
Returns a decoration of this node.

Parameters:
name - the decoration's name.
Returns:
a decoration of this node. May be null if this node does not have a decoration with the specified name.

astSetDecoration

public void astSetDecoration(String name,
                             Object decoration)
Sets a decoration of this node.

Parameters:
name - the decoration's name.
decoration - a decoration.

astGetDecorations

public Map astGetDecorations()
Returns the decorations of this node.

Returns:
the decorations of this node.

astSetDecorations

public void astSetDecorations(Map decorations)
Sets the decorations of this node.

Parameters:
decorations - the decorations of this node that must be changed (decorations that are not defined in this argument are left unchanged).

astGetNodeTypes

public String[] astGetNodeTypes()
Returns the types of the sub nodes that this node can have.

Returns:
the types of the sub nodes that this node can have.

astGetNodes

public Node[] astGetNodes(String type)
Returns the sub nodes of this node that are of the given type.

Parameters:
type - a node type.
Returns:
the sub nodes of this node that are of the given type.

astAddNode

public void astAddNode(Node node)
Adds a sub node to this node.

Parameters:
node - the sub node to be added to this node.

astRemoveNode

public void astRemoveNode(Node node)
Removes a sub node from this node.

Parameters:
node - the sub node to be removed from this node.

astNewInstance

public Node astNewInstance()
Creates a new, empty AST node of the same type as this node.

Returns:
a new, empty AST node of the same type as this node.