|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public String astGetType()
public String astGetSource()
public void astSetSource(String source)
source
- the source of this node (such as a file name).public Map astGetAttributes()
public void astSetAttributes(Map attributes)
attributes
- the attributes of this node that must be changed
(attributes that are not defined in this argument are left unchanged).public Object astGetDecoration(String name)
name
- the decoration's name.
null
if this node
does not have a decoration with the specified name.public void astSetDecoration(String name, Object decoration)
name
- the decoration's name.decoration
- a decoration.public Map astGetDecorations()
public void astSetDecorations(Map decorations)
decorations
- the decorations of this node that must be changed
(decorations that are not defined in this argument are left unchanged).public String[] astGetNodeTypes()
public Node[] astGetNodes(String type)
type
- a node type.
public void astAddNode(Node node)
node
- the sub node to be added to this node.public void astRemoveNode(Node node)
node
- the sub node to be removed from this node.public Node astNewInstance()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |