public class Node extends Object implements groovy.lang.Writable
Constructor and Description |
---|
Node(Node parent,
String name,
Map attributes,
Map attributeNamespaces,
String namespaceURI) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Object child)
Adds an object as a new child to this Node.
|
protected void |
appendNode(Object newValue,
GPathResult result) |
Map |
attributes()
Returns a map of the attributes of this Node.
|
void |
build(groovy.lang.GroovyObject builder,
Map namespaceMap,
Map<String,String> namespaceTagHints) |
Iterator |
childNodes()
Returns an iterator over the child nodes of this Node.
|
List |
children()
Returns a list of the children of this Node.
|
List<String> |
localText()
Returns the list of any direct String nodes of this node.
|
String |
name()
Returns the name of this Node.
|
String |
namespaceURI()
Returns the URI of the namespace of this Node.
|
Node |
parent()
Returns the parent of this Node.
|
protected void |
replaceBody(Object newValue)
Replaces the current body of this Node with the passed object.
|
void |
replaceNode(groovy.lang.Closure replacementClosure,
GPathResult result) |
String |
text()
Returns a string containing the text of the children of this Node.
|
Writer |
writeTo(Writer out) |
public Node(Node parent, String name, Map attributes, Map attributeNamespaces, String namespaceURI)
parent
- the parent nodename
- the name for the nodeattributes
- the attributes for the nodeattributeNamespaces
- the namespace mappings for attributesnamespaceURI
- the namespace URI if anypublic String name()
public Node parent()
public String namespaceURI()
public Map attributes()
public List children()
public void addChild(Object child)
child
- the object to add as a childpublic void replaceNode(groovy.lang.Closure replacementClosure, GPathResult result)
protected void replaceBody(Object newValue)
newValue
- the new bodyprotected void appendNode(Object newValue, GPathResult result)
public String text()
public List<String> localText()
public Iterator childNodes()
public Writer writeTo(Writer out) throws IOException
writeTo
in interface groovy.lang.Writable
IOException