public abstract class GPathResult extends GroovyObjectSupport implements Writable, Buildable
| Modifier and Type | Field and Description |
|---|---|
protected String |
name |
protected Map |
namespaceMap |
protected String |
namespacePrefix |
protected Map<String,String> |
namespaceTagHints |
protected GPathResult |
parent |
| Constructor and Description |
|---|
GPathResult(GPathResult parent,
String name,
String namespacePrefix,
Map<String,String> namespaceTagHints) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
appendNode(Object newValue) |
Iterator |
breadthFirst()
An iterator useful for traversing XML documents/fragments in breadth-first order.
|
abstract Iterator |
childNodes() |
GPathResult |
children() |
GPathResult |
declareNamespace(Map newNamespaceMapping) |
Iterator |
depthFirst() |
boolean |
equals(Object obj) |
abstract GPathResult |
find(Closure closure) |
abstract GPathResult |
findAll(Closure closure) |
Object |
getAt(int index) |
Object |
getAt(IntRange range) |
Closure |
getBody() |
Object |
getProperty(String property)
Retrieves a property value.
|
boolean |
isEmpty() |
abstract Iterator |
iterator() |
Object |
leftShift(Object newValue) |
List |
list() |
String |
lookupNamespace(String prefix) |
String |
name() |
abstract Iterator |
nodeIterator() |
GPathResult |
parent() |
abstract GPathResult |
parents() |
Object |
plus(Object newValue) |
void |
putAt(int index,
Object newValue) |
protected abstract void |
replaceBody(Object newValue) |
protected abstract void |
replaceNode(Closure newValue) |
void |
setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation.
|
void |
setProperty(String property,
Object newValue)
Sets the given property to the new value.
|
abstract int |
size() |
abstract String |
text() |
BigDecimal |
toBigDecimal() |
BigInteger |
toBigInteger() |
Boolean |
toBoolean() |
Double |
toDouble() |
Float |
toFloat() |
Integer |
toInteger() |
Long |
toLong() |
String |
toString() |
URI |
toURI() |
URL |
toURL() |
getMetaClass, invokeMethodprotected final GPathResult parent
protected final String name
protected final String namespacePrefix
protected final Map namespaceMap
public GPathResult(GPathResult parent, String name, String namespacePrefix, Map<String,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)
GroovyObjectsetMetaClass in interface GroovyObjectsetMetaClass in class GroovyObjectSupportmetaClass - the new metaclasspublic Object getProperty(String property)
GroovyObjectgetProperty in interface GroovyObjectgetProperty in class GroovyObjectSupportproperty - the name of the property of interestpublic void setProperty(String property, Object newValue)
GroovyObjectsetProperty in interface GroovyObjectsetProperty in class GroovyObjectSupportproperty - the name of the property of interestnewValue - the new value for the propertyprotected abstract void replaceNode(Closure newValue)
protected abstract void replaceBody(Object newValue)
protected abstract void appendNode(Object newValue)
public String name()
public GPathResult parent()
public GPathResult children()
public Integer toInteger()
public Long toLong()
public Float toFloat()
public Double toDouble()
public BigDecimal toBigDecimal()
public BigInteger toBigInteger()
public URL toURL() throws MalformedURLException
MalformedURLExceptionpublic URI toURI() throws URISyntaxException
URISyntaxExceptionpublic Boolean toBoolean()
public GPathResult declareNamespace(Map newNamespaceMapping)
public Object getAt(int index)
public void putAt(int index,
Object newValue)
public Iterator depthFirst()
public Iterator breadthFirst()
public List list()
public boolean isEmpty()
public Closure getBody()
public abstract int size()
public abstract String text()
public abstract GPathResult parents()
public abstract Iterator childNodes()
public abstract Iterator iterator()
public abstract GPathResult find(Closure closure)
public abstract GPathResult findAll(Closure closure)
public abstract Iterator nodeIterator()