[Java] Class NodeChild
- groovy.util.slurpersupport.NodeChild
Lazy evaluated representation of a child node.
- Authors:
- John Wilson
Fields inherited from class | Fields |
---|---|
class GPathResult | name, namespaceMap, namespacePrefix, namespaceTagHints, parent |
Constructor Summary
Constructor and description |
---|
NodeChild
(Node node, GPathResult parent, String namespacePrefix, Map<String, String> namespaceTagHints) @param node a node |
NodeChild
(Node node, GPathResult parent, Map<String, String> namespaceTagHints) @param node a node |
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
protected void |
appendNode(Object newValue) | |
Map |
attributes() Returns a map containing all attributes of the Node of this NodeChild. | |
void |
build(GroovyObject builder) | |
Iterator |
childNodes() | |
GPathResult |
find(Closure closure) | |
GPathResult |
findAll(Closure closure) | |
Object |
getAt(int index) | |
Iterator |
iterator() | |
List<String> |
localText() Returns the list of any direct String nodes of this NodeChild. | |
String |
namespaceURI() Returns the URI of the namespace of this NodeChild. | |
Iterator |
nodeIterator() | |
GPathResult |
parent() | |
GPathResult |
parents() Throws a GroovyRuntimeException , because this method is not implemented yet. | |
protected void |
replaceBody(Object newValue) | |
protected void |
replaceNode(Closure newValue) | |
int |
size() | |
String |
text() | |
Writer |
writeTo(Writer out) |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class GPathResult | appendNode, breadthFirst, childNodes, children, declareNamespace, depthFirst, equals, find, findAll, getAt, getAt, getBody, getProperty, hashCode, isEmpty, iterator, leftShift, list, lookupNamespace, name, nodeIterator, parent, parents, plus, pop, putAt, replaceBody, replaceNode, setMetaClass, setProperty, size, text, toBigDecimal, toBigInteger, toBoolean, toDouble, toFloat, toInteger, toLong, toString, toURI, toURL |
class GroovyObjectSupport | getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail
public NodeChild(Node node, GPathResult parent, String namespacePrefix, Map<String, String> namespaceTagHints)
- Parameters:
-
node
- a node -
parent
- the GPathResult prior to the application of the expression creating this GPathResult -
namespacePrefix
- the namespace prefix if any -
namespaceTagHints
- the known tag to namespace mappings
public NodeChild(Node node, GPathResult parent, Map<String, String> namespaceTagHints)
- Parameters:
-
node
- a node -
parent
- the GPathResult prior to the application of the expression creating this GPathResult -
namespaceTagHints
- the known tag to namespace mappings
Method Detail
protected void appendNode(Object newValue)
public Map attributes()
Returns a map containing all attributes of the Node of this NodeChild.
- Returns:
- a map containing all attributes
public void build(GroovyObject builder)
public Iterator childNodes()
public GPathResult find(Closure closure)
public GPathResult findAll(Closure closure)
public Object getAt(int index)
public Iterator iterator()
public List<String> localText()
Returns the list of any direct String nodes of this NodeChild.
- Returns:
- the list of String values from this node
- Since:
- 2.3.0
public String namespaceURI()
Returns the URI of the namespace of this NodeChild.
- Returns:
- the namespace of this NodeChild
public Iterator nodeIterator()
public GPathResult parent()
public GPathResult parents()
Throws a GroovyRuntimeException
, because this method is not implemented yet.
protected void replaceBody(Object newValue)
protected void replaceNode(Closure newValue)
public int size()
public String text()
public Writer writeTo(Writer out)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/groovy/util/slurpersupport/NodeChild.html