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
|
<T> T |
get(String name)
Get a value from the current XML object.
|
Object |
getBackingGroovyObject() |
Object |
getGroovyNodes() |
<T> List<T> |
getList(String name) |
groovy.lang.MetaClass |
getMetaClass() |
Object |
getNodeList() |
<T> T |
getPath(String path)
Get a value from the current XML using Groovy's GPath expression syntax.
|
Object |
getProperty(String property) |
Object |
invokeMethod(String method,
Object arguments) |
boolean |
isEmpty() |
Iterator<String> |
iterator() |
Object |
leftShift(Node node) |
List<Node> |
list() |
Iterable<Node> |
nodeIterable() |
Iterator<Node> |
nodeIterator() |
void |
setGroovyNodes(Object value) |
void |
setMetaClass(groovy.lang.MetaClass mc) |
void |
setNodeList(Object value) |
void |
setProperty(String property,
Object value) |
int |
size() |
String |
toString() |
get, getNode, getNodes, getPath
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNode, getNodes, getPath
forEach, spliterator
public groovy.lang.MetaClass getMetaClass()
getMetaClass
in interface groovy.lang.GroovyObject
getMetaClass
in class NodeBase
public void setMetaClass(groovy.lang.MetaClass mc)
setMetaClass
in interface groovy.lang.GroovyObject
setMetaClass
in class NodeBase
public Object invokeMethod(String method, Object arguments)
invokeMethod
in interface groovy.lang.GroovyObject
invokeMethod
in class NodeBase
public Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class NodeBase
public void setProperty(String property, Object value)
setProperty
in interface groovy.lang.GroovyObject
setProperty
in class NodeBase
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<Node> nodeIterable()
nodeIterable
in interface NodeChildren
public <T> T 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
T
- The expected type of the return value.name
- The name of the child, children or attribute.public <T> T getPath(String path)
PathElement
getPath
in interface PathElement
getPath
in class NodeBase
T
- The expected type of the return value.path
- The GPath expression syntaxpublic Iterator<Node> nodeIterator()
nodeIterator
in interface NodeChildren
public List<Node> list()
list
in interface NodeChildren
public Object getBackingGroovyObject()
getBackingGroovyObject
in class NodeBase
Copyright © 2010–2016. All rights reserved.