public class NodeChildrenImpl extends NodeBase implements NodeChildren
Modifier and Type | Class and Description |
---|---|
class |
NodeChildrenImpl.NodeListIterator |
Constructor and Description |
---|
NodeChildrenImpl() |
Modifier and Type | Method and Description |
---|---|
Node |
get(int index)
The the Node on the nth index
|
Object |
get(String name)
Get a value from the current XML object.
|
Object |
getBackingGroovyObject() |
Object |
getGroovyNodes() |
<T> List |
getList(String name) |
Object |
getNodeList() |
Object |
getPath(String path)
Get a value from the current XML using Groovy's GPath expression syntax.
|
boolean |
isEmpty() |
Iterator |
iterator() |
Object |
leftShift(Node node) |
List |
list() |
Iterable |
nodeIterable() |
Iterator |
nodeIterator() |
void |
setGroovyNodes(Object value) |
void |
setNodeList(Object value) |
int |
size() |
String |
toString() |
get, getMetaClass, getNode, getNodes, getPath, getProperty, invokeMethod, setMetaClass, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNode, getNodes, getPath
forEach, spliterator
public Object getNodeList()
public void setNodeList(Object value)
public Object getGroovyNodes()
public void setGroovyNodes(Object value)
public Node get(int index)
NodeChildren
get
in interface NodeChildren
index
- The index of the node the getpublic int size()
size
in interface NodeChildren
public boolean isEmpty()
isEmpty
in interface NodeChildren
true
if there are no children, false
otherwise.public Iterable nodeIterable()
nodeIterable
in interface NodeChildren
public Object get(String name)
PathElement
This method returns the child whose name matches name
. If several
children matches the name then a List
of Node's
are returned.
If this object is a Node and you want to return an attribute value you need to prefix the name with an @. E.g. given
<category type="present"> <item when="Aug 10"> <name>Kathryn's Birthday</name> <price>200</price> </item> </category>then
String type = node.get("@type");will return "present".
get
in interface PathElement
get
in class NodeBase
name
- The name of the child, children or attribute.public Object getPath(String path)
PathElement
getPath
in interface PathElement
getPath
in class NodeBase
path
- The GPath expression syntaxpublic Iterator nodeIterator()
nodeIterator
in interface NodeChildren
public List list()
list
in interface NodeChildren
public Object getBackingGroovyObject()
getBackingGroovyObject
in class NodeBase
Copyright © 2010–2019. All rights reserved.