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, setMetaClassclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNode, getNodes, getPathforEach, spliteratorpublic Object getNodeList()
public void setNodeList(Object value)
public Object getGroovyNodes()
public void setGroovyNodes(Object value)
public Node get(int index)
NodeChildrenget in interface NodeChildrenindex - The index of the node the getpublic int size()
size in interface NodeChildrenpublic boolean isEmpty()
isEmpty in interface NodeChildrentrue if there are no children, false otherwise.public Iterable nodeIterable()
nodeIterable in interface NodeChildrenpublic 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 PathElementget in class NodeBasename - The name of the child, children or attribute.public Object getPath(String path)
PathElementgetPath in interface PathElementgetPath in class NodeBasepath - The GPath expression syntaxpublic Iterator nodeIterator()
nodeIterator in interface NodeChildrenpublic List list()
list in interface NodeChildrenpublic Object getBackingGroovyObject()
getBackingGroovyObject in class NodeBaseCopyright © 2010–2020. All rights reserved.