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