org.objectweb.fractal.adl
Interface Node
- AbstractNode, XMLNode
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).
astAddNode
public void astAddNode(Node node)
Adds a sub node to this node.
node
- the sub node to be added to this node.
astGetAttributes
public Map astGetAttributes()
Returns the attributes of this node.
- the attributes of this node.
astGetDecoration
public Object astGetDecoration(String name)
Returns a decoration of this node.
name
- the decoration's name.
- a decoration of this node. May be
null
if this node
does not have a decoration with the specified name.
astGetDecorations
public Map astGetDecorations()
Returns the decorations of this node.
- the decorations of this node.
astGetNodeTypes
public String[] astGetNodeTypes()
Returns the types of the sub nodes that this node can have.
- 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.
type
- a node type.
- the sub nodes of this node that are of the given type.
astGetSource
public String astGetSource()
Returns the source of this node.
- the source of this node (such as a file name).
astGetType
public String astGetType()
Returns the type of this node.
- the type of this node.
astNewInstance
public Node astNewInstance()
Creates a new, empty AST node of the same type as this node.
- a new, empty AST node of the same type as this node.
astRemoveNode
public void astRemoveNode(Node node)
Removes a sub node from this node.
node
- the sub node to be removed from this node.
astSetAttributes
public void astSetAttributes(Map attributes)
Sets the attributes of this node.
attributes
- the attributes of this node that must be changed
(attributes that are not defined in this argument are left unchanged).
astSetDecoration
public void astSetDecoration(String name,
Object decoration)
Sets a decoration of this node.
name
- the decoration's name.decoration
- a decoration.
astSetDecorations
public void astSetDecorations(Map decorations)
Sets the decorations of this node.
decorations
- the decorations of this node that must be changed
(decorations that are not defined in this argument are left unchanged).
astSetSource
public void astSetSource(String source)
Sets the source of this node.
source
- the source of this node (such as a file name).