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, getPathclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNode, getNodes, getPathpublic groovy.lang.MetaClass getMetaClass()
getMetaClass in interface groovy.lang.GroovyObjectgetMetaClass in class NodeBasepublic void setMetaClass(groovy.lang.MetaClass mc)
setMetaClass in interface groovy.lang.GroovyObjectsetMetaClass in class NodeBasepublic Object invokeMethod(String method, Object arguments)
invokeMethod in interface groovy.lang.GroovyObjectinvokeMethod in class NodeBasepublic Object getProperty(String property)
getProperty in interface groovy.lang.GroovyObjectgetProperty in class NodeBasepublic void setProperty(String property, Object value)
setProperty in interface groovy.lang.GroovyObjectsetProperty in class NodeBasepublic 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<Node> nodeIterable()
nodeIterable in interface NodeChildrenpublic <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 PathElementget in class NodeBaseT - The expected type of the return value.name - The name of the child, children or attribute.public <T> T getPath(String path)
PathElementgetPath in interface PathElementgetPath in class NodeBaseT - The expected type of the return value.path - The GPath expression syntaxpublic Iterator<Node> nodeIterator()
nodeIterator in interface NodeChildrenpublic List<Node> list()
list in interface NodeChildrenpublic Object getBackingGroovyObject()
getBackingGroovyObject in class NodeBaseCopyright © 2010–2014. All rights reserved.