|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.sequencer.ddl.node.AstNodeFactory
public class AstNodeFactory
Utility class which provides construction, editing and assorted methods to work with AstNodes.
Constructor Summary | |
---|---|
AstNodeFactory()
|
|
AstNodeFactory(ExecutionContext context)
|
Method Summary | |
---|---|
int |
createInt(String stringValue)
|
AstNode |
getChildforNameAndType(AstNode astNode,
String name,
Name nodeType)
Utility method to obtain a AstNode child of a parent AstNode with the given string name and node type. |
List<AstNode> |
getChildrenForType(AstNode astNode,
Name nodeType)
Utility method to obtain the children of a given node that match the given type |
boolean |
hasMixinType(AstNode node,
Name mixinType)
Utility method to determine if an AstNode contains a specific mixin type. |
Name |
name(String name)
Constructs a Name with the given string name |
AstNode |
node(String name)
Constructs an AstNode with the given string name |
AstNode |
node(String name,
AstNode parent,
Name type)
Constructs an AstNode with the given name, type and parent node. |
AstNode |
node(String name,
AstNode parent,
Object... types)
Constructs an AstNode with the given name, types and parent node. |
void |
setType(AstNode node,
Name type)
Sets the mixin type property for an AstNode |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AstNodeFactory(ExecutionContext context)
context
- public AstNodeFactory()
Method Detail |
---|
public Name name(String name)
Name
with the given string name
name
- the name to use in constructing a Name
instance; may not be null
Name
graph property objectpublic AstNode node(String name)
AstNode
with the given string name
name
- the name property of the node; may not be null
public AstNode node(String name, AstNode parent, Object... types)
AstNode
with the given name, types and parent node.
name
- the name property of the node; may not be nullparent
- the parent of the node; may not be nulltypes
- the list of mixin types Name
for the requested node; may not be null or empty
public AstNode node(String name, AstNode parent, Name type)
AstNode
with the given name, type and parent node.
name
- the name property of the node; may not be nullparent
- the parent of the node; may not be nulltype
- the mixin type Name
for the requested node; may not be null
public void setType(AstNode node, Name type)
AstNode
node
- the node to set the property on; may not be nulltype
- the mixin type Name
; may not be nullpublic List<AstNode> getChildrenForType(AstNode astNode, Name nodeType)
astNode
- the parent node; may not be nullnodeType
- the type property of the target child node; may not be null
public AstNode getChildforNameAndType(AstNode astNode, String name, Name nodeType)
AstNode
child of a parent AstNode
with the given string name and node type.
astNode
- the parent node; may not be nullname
- the name property of the node; may not be nullnodeType
- the type property of the target child node; may not be null
public boolean hasMixinType(AstNode node, Name mixinType)
AstNode
contains a specific mixin type.
node
- the AstNodemixinType
- the target mixin type Name
; may not be null;
public int createInt(String stringValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |