| Modifier and Type | Field and Description |
|---|---|
| private final Node |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | appendNode(final Object newValue)
Implements abstract groovy. |
| public Map | Returns: a map containing all attributesReturns a map containing all attributes of the Node of this NodeChild. |
| public void | |
| public Iterator | childNodes()
Implements abstract groovy. |
| public GPathResult | find(final Closure<V>
a closure to filters the children of this GPathResult closure)Implements abstract groovy. |
| public GPathResult | findAll(final Closure<V>
a closure to filters the children of this GPathResult closure)Implements abstract groovy. |
| public Object | getAt(final int
an index index)Overrides groovy. |
| public Iterator | iterator()
Implements abstract groovy. Implements java. T.
|
| public List | Returns: the list of String values from this nodeReturns the list of any direct String nodes of this NodeChild. |
| public String | Returns: the namespace of this NodeChildReturns the URI of the namespace of this NodeChild. |
| public Iterator | |
| public GPathResult | parent()
Overrides groovy. |
| public GPathResult | parents()
Implements abstract groovy. GroovyRuntimeException, because this method is not implemented yet.
|
| protected void | replaceBody(final Object newValue)
Implements abstract groovy. |
| protected void | replaceNode(final Closure<V> newValue)
Implements abstract groovy. |
| public int | size()
Implements abstract groovy. |
| public String | text()
Implements abstract groovy. String.
|
| public Writer | writeTo(final Writer
the Writer to which this Writable should output its data. out)Implements groovy. |
| node | back to summary |
|---|---|
| private final Node node | |
| NodeChild | back to summary |
|---|---|
| public NodeChild(final Node node, final GPathResult parent, final String namespacePrefix, final Map<String, String> namespaceTagHints) | |
| NodeChild | back to summary |
|---|---|
public NodeChild(final Node node, final GPathResult parent, final Map<String, String> namespaceTagHints)
| |
| appendNode | back to summary |
|---|---|
| protected void appendNode(final Object newValue) Implements abstract groovy. | |
| attributes | back to summary |
|---|---|
| public Map Returns a map containing all attributes of the Node of this NodeChild.
| |
| build | back to summary |
|---|---|
| public void build(final GroovyObject builder) Implements groovy. | |
| childNodes | back to summary |
|---|---|
| public Iterator Implements abstract groovy. Doc from groovy. Returns an iterator over the child nodes of this GPathResult.
| |
| find | back to summary |
|---|---|
| public GPathResult find(final Closure<V> closure) Implements abstract groovy. Doc from groovy. Returns the first child of this GPathResult matching the condition(s) specified in the passed closure.
| |
| findAll | back to summary |
|---|---|
| public GPathResult findAll(final Closure<V> closure) Implements abstract groovy. Doc from groovy. Returns the children of this GPathResult matching the condition(s) specified in the passed closure.
| |
| getAt | back to summary |
|---|---|
| public Object getAt(final int index) Overrides groovy. Doc from groovy. Supports the subscript operator for a GPathResult.
import groovy.xml.slurpersupport.*
import groovy.xml.XmlSlurper
def text = """
<characterList>
<character/>
<character>
<name>Gromit</name>
</character>
</characterList>"""
GPathResult characterList = new XmlSlurper().parseText(text)
assert characterList.character[1].name == 'Gromit'
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements abstract groovy. Implements java. Doc from java. Returns an iterator over elements of type
| |
| localText | back to summary |
|---|---|
| public List Returns the list of any direct String nodes of this NodeChild. | |
| namespaceURI | back to summary |
|---|---|
| public String namespaceURI() Returns the URI of the namespace of this NodeChild.
| |
| nodeIterator | back to summary |
|---|---|
| public Iterator Implements abstract groovy. | |
| parent | back to summary |
|---|---|
| public GPathResult parent() Overrides groovy. Doc from groovy. Returns as GPathResult with the parent nodes of the current GPathResult
| |
| parents | back to summary |
|---|---|
| public GPathResult parents() Implements abstract groovy. Throws a
| |
| replaceBody | back to summary |
|---|---|
| protected void replaceBody(final Object newValue) Implements abstract groovy. | |
| replaceNode | back to summary |
|---|---|
| protected void replaceNode(final Closure<V> newValue) Implements abstract groovy. | |
| size | back to summary |
|---|---|
| public int size() Implements abstract groovy. Doc from groovy. Returns the size of this GPathResult.
| |
| text | back to summary |
|---|---|
| public String text() Implements abstract groovy. Doc from groovy. Returns the text of this GPathResult as a
| |
| writeTo | back to summary |
|---|---|
| public Writer writeTo(final Writer out) throws IOException Implements groovy. Doc from groovy. Writes this object to the given writer. This is used to defer content creation until the point when it is streamed to the output destination. Oftentimes, content will be defined but not necessarily created (as is may be the case with a Closure definition.) In that case, the output is then 'deferred' to the point when it is serialized to the writer. This class may be used whenever an object should be responsible for creating its own textual representation, but creating the entire output as a single String would be inefficient (such as outputting a multi-gigabyte XML document.)
| |