public final class AstNodeFactory extends Object
Constructor and Description |
---|
AstNodeFactory() |
Modifier and Type | Method and Description |
---|---|
AstNode |
getChildforNameAndType(AstNode astNode,
String name,
String nodeType)
|
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 |
public AstNode node(String name)
AstNode
with the given string namename
- the name property of the node; may not be nullpublic 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 emptypublic 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 nullpublic 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 nullpublic 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 nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.