|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.sequencer.ddl.node.AstNodeFactory
public final class AstNodeFactory
Utility class which provides construction, editing and assorted methods to work with AstNodes.
Constructor Summary | |
---|---|
AstNodeFactory()
|
Method Summary | |
---|---|
AstNode |
getChildforNameAndType(AstNode astNode,
String name,
String 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,
String nodeType)
Utility method to obtain the children of a given node that match the given type |
boolean |
hasMixinType(AstNode node,
String mixinType)
Utility method to determine if an AstNode contains a specific mixin type. |
AstNode |
node(String name)
Constructs an AstNode with the given string name |
AstNode |
node(String name,
AstNode parent,
Object... types)
Constructs an AstNode with the given name, types and parent node. |
AstNode |
node(String name,
AstNode parent,
String type)
Constructs an AstNode with the given name, type and parent node. |
void |
setType(AstNode node,
String type)
Sets the mixin type property for an AstNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AstNodeFactory()
Method Detail |
---|
public 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 mixin types; may not be null, but may be empty
public AstNode node(String name, AstNode parent, String 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 String
for the requested node; may not be null
public void setType(AstNode node, String type)
AstNode
node
- the node to set the property on; may not be nulltype
- the mixin type String
; may not be nullpublic List<AstNode> getChildrenForType(AstNode astNode, String 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, String 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, String mixinType)
AstNode
contains a specific mixin type.
node
- the AstNodemixinType
- the target mixin type String
; may not be null;
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |