public abstract class GPathResult extends GroovyObjectSupport implements Writable, Buildable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name |
protected java.util.Map |
namespaceMap |
protected java.lang.String |
namespacePrefix |
protected java.util.Map<java.lang.String,java.lang.String> |
namespaceTagHints |
protected GPathResult |
parent |
Constructor and Description |
---|
GPathResult(GPathResult parent,
java.lang.String name,
java.lang.String namespacePrefix,
java.util.Map<java.lang.String,java.lang.String> namespaceTagHints) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
appendNode(java.lang.Object newValue) |
java.util.Iterator |
breadthFirst()
An iterator useful for traversing XML documents/fragments in breadth-first order.
|
abstract java.util.Iterator |
childNodes() |
GPathResult |
children() |
GPathResult |
declareNamespace(java.util.Map newNamespaceMapping) |
java.util.Iterator |
depthFirst() |
boolean |
equals(java.lang.Object obj) |
abstract GPathResult |
find(Closure closure) |
abstract GPathResult |
findAll(Closure closure) |
java.lang.Object |
getAt(int index) |
java.lang.Object |
getAt(IntRange range) |
Closure |
getBody() |
java.lang.Object |
getProperty(java.lang.String property)
Retrieves a property value.
|
boolean |
isEmpty() |
abstract java.util.Iterator |
iterator() |
java.lang.Object |
leftShift(java.lang.Object newValue) |
java.util.List |
list() |
java.lang.String |
lookupNamespace(java.lang.String prefix) |
java.lang.String |
name() |
abstract java.util.Iterator |
nodeIterator() |
GPathResult |
parent() |
abstract GPathResult |
parents() |
java.lang.Object |
plus(java.lang.Object newValue) |
void |
putAt(int index,
java.lang.Object newValue) |
protected abstract void |
replaceBody(java.lang.Object newValue) |
protected abstract void |
replaceNode(Closure newValue) |
void |
setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation.
|
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Sets the given property to the new value.
|
abstract int |
size() |
abstract java.lang.String |
text() |
java.math.BigDecimal |
toBigDecimal() |
java.math.BigInteger |
toBigInteger() |
java.lang.Boolean |
toBoolean() |
java.lang.Double |
toDouble() |
java.lang.Float |
toFloat() |
java.lang.Integer |
toInteger() |
java.lang.Long |
toLong() |
java.lang.String |
toString() |
java.net.URI |
toURI() |
java.net.URL |
toURL() |
getMetaClass, invokeMethod
protected final GPathResult parent
protected final java.lang.String name
protected final java.lang.String namespacePrefix
protected final java.util.Map namespaceMap
protected final java.util.Map<java.lang.String,java.lang.String> namespaceTagHints
public GPathResult(GPathResult parent, java.lang.String name, java.lang.String namespacePrefix, java.util.Map<java.lang.String,java.lang.String> namespaceTagHints)
parent
- the GPathResult prior to the application of the expression creating this GPathResultname
- if the GPathResult corresponds to something with a name, e.g. a nodenamespacePrefix
- the namespace prefix if anynamespaceTagHints
- the known tag to namespace mappingspublic void setMetaClass(MetaClass metaClass)
GroovyObject
setMetaClass
in interface GroovyObject
setMetaClass
in class GroovyObjectSupport
metaClass
- the new metaclasspublic java.lang.Object getProperty(java.lang.String property)
GroovyObject
getProperty
in interface GroovyObject
getProperty
in class GroovyObjectSupport
property
- the name of the property of interestpublic void setProperty(java.lang.String property, java.lang.Object newValue)
GroovyObject
setProperty
in interface GroovyObject
setProperty
in class GroovyObjectSupport
property
- the name of the property of interestnewValue
- the new value for the propertypublic java.lang.Object leftShift(java.lang.Object newValue)
public java.lang.Object plus(java.lang.Object newValue)
protected abstract void replaceNode(Closure newValue)
protected abstract void replaceBody(java.lang.Object newValue)
protected abstract void appendNode(java.lang.Object newValue)
public java.lang.String name()
public GPathResult parent()
public GPathResult children()
public java.lang.String lookupNamespace(java.lang.String prefix)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Integer toInteger()
public java.lang.Long toLong()
public java.lang.Float toFloat()
public java.lang.Double toDouble()
public java.math.BigDecimal toBigDecimal()
public java.math.BigInteger toBigInteger()
public java.net.URL toURL() throws java.net.MalformedURLException
java.net.MalformedURLException
public java.net.URI toURI() throws java.net.URISyntaxException
java.net.URISyntaxException
public java.lang.Boolean toBoolean()
public GPathResult declareNamespace(java.util.Map newNamespaceMapping)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object getAt(int index)
public java.lang.Object getAt(IntRange range)
public void putAt(int index, java.lang.Object newValue)
public java.util.Iterator depthFirst()
public java.util.Iterator breadthFirst()
public java.util.List list()
public boolean isEmpty()
public Closure getBody()
public abstract int size()
public abstract java.lang.String text()
public abstract GPathResult parents()
public abstract java.util.Iterator childNodes()
public abstract java.util.Iterator iterator()
public abstract GPathResult find(Closure closure)
public abstract GPathResult findAll(Closure closure)
public abstract java.util.Iterator nodeIterator()