Modifier and Type | Class and Description |
---|---|
class |
NodeImpl.ValueIterator |
Constructor and Description |
---|
NodeImpl() |
Modifier and Type | Method and Description |
---|---|
Map |
attributes()
The node attributes, may be empty.
|
NodeChildren |
children()
The node children
|
Node |
get(int index) |
Object |
get(String name)
Get a value from the current XML object.
|
String |
getAttribute(String name)
Get the value of an attribute.
|
Object |
getAttributes() |
Object |
getBackingGroovyObject() |
boolean |
getBoolean(String name) |
byte |
getByte(String name) |
char |
getChar(String name) |
NodeChildren |
getChildren() |
double |
getDouble(String name) |
float |
getFloat(String name) |
Object |
getGroovyNode() |
int |
getInt(String name) |
<T> List |
getList(String name) |
long |
getLong(String name) |
Object |
getName() |
Object |
getPath(String path)
Get a value from the current XML using Groovy's GPath expression syntax.
|
short |
getShort(String name) |
Object |
getValue() |
Iterator |
iterator() |
Object |
leftShift(Node node) |
String |
name()
The name of the node
|
void |
setAttributes(Object value) |
void |
setChildren(NodeChildren value) |
void |
setGroovyNode(Object value) |
void |
setName(Object value) |
void |
setValue(Object value) |
String |
toString() |
String |
value()
The node value.
|
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 getAttributes()
public void setAttributes(Object value)
public NodeChildren getChildren()
public void setChildren(NodeChildren value)
public Object getName()
public void setName(Object value)
public Object getValue()
public void setValue(Object value)
public Object getGroovyNode()
public void setGroovyNode(Object value)
public Map attributes()
Node
attributes
in interface Node
public Node get(int index)
public NodeChildren children()
Node
public String getAttribute(String name)
Node
getAttribute
in interface Node
name
- The name of the attribute to getpublic float getFloat(String name)
public double getDouble(String name)
public char getChar(String name)
public boolean getBoolean(String name)
public long getLong(String name)
public int getInt(String name)
public short getShort(String name)
public byte getByte(String name)
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 String value()
Node
public Object getBackingGroovyObject()
getBackingGroovyObject
in class NodeBase
Copyright © 2010–2020. All rights reserved.