Groovy Documentation

## groovy.util.slurpersupport
[Java] Class GPathResult

    java.lang.Object
      groovy.lang.GroovyObjectSupport
          groovy.util.slurpersupport.GPathResult

All Implemented Interfaces:
  Buildable, Writable

    public abstract class GPathResult
    extends GroovyObjectSupport

Base class for representing lazy evaluated GPath expressions.

Authors:
  John Wilson

Field Summary
`protected java.lang.String` | `name`
`protected java.util.Map` | `namespaceMap`
`protected java.lang.String` | `namespacePrefix`
`protected java.util.Map` | `namespaceTagHints`
`protected GPathResult` | `parent`

Constructor Summary
`GPathResult(GPathResult parent, java.lang.String name, java.lang.String namespacePrefix, java.util.Map namespaceTagHints)` @param parent the GPathResult prior to the application of the expression creating this GPathResult

Method Summary
`protected void` | `appendNode(java.lang.Object newValue)`
`java.util.Iterator` | `breadthFirst()` An iterator useful for traversing XML documents/fragments in breadth-first order.
`java.util.Iterator` | `childNodes()`
`GPathResult` | `children()`
`GPathResult` | `declareNamespace(java.util.Map newNamespaceMapping)`
`java.util.Iterator` | `depthFirst()`
`boolean` | `equals(java.lang.Object obj)`
`GPathResult` | `find(Closure closure)`
`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)`
`boolean` | `isEmpty()`
`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()`
`java.util.Iterator` | `nodeIterator()`
`GPathResult` | `parent()`
`GPathResult` | `parents()`
`java.lang.Object` | `plus(java.lang.Object newValue)`
`void` | `putAt(int index, java.lang.Object newValue)`
`protected void` | `replaceBody(java.lang.Object newValue)`
`protected void` | `replaceNode(Closure newValue)`
`void` | `setMetaClass(MetaClass metaClass)`
`void` | `setProperty(java.lang.String property, java.lang.Object newValue)`
`int` | `size()`
`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()`

Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### name

    protected final java.lang.String name

### namespaceMap

    protected final java.util.Map namespaceMap

### namespacePrefix

    protected final java.lang.String namespacePrefix

### namespaceTagHints

    protected final java.util.Map namespaceTagHints

### parent

    protected final GPathResult parent

Constructor Detail

### GPathResult

    public GPathResult(GPathResult parent, java.lang.String name, java.lang.String namespacePrefix, java.util.Map namespaceTagHints)

  Parameters:
    `parent` - the GPathResult prior to the application of the expression creating this GPathResult
    `name` - if the GPathResult corresponds to something with a name, e.g. a node
    `namespacePrefix` - the namespace prefix if any
    `namespaceTagHints` - the known tag to namespace mappings

Method Detail

### appendNode

    protected void appendNode(java.lang.Object newValue)

### breadthFirst

    public java.util.Iterator breadthFirst()

  An iterator useful for traversing XML documents/fragments in breadth-first order.
  Returns:
    Iterator the iterator of GPathResult objects

### childNodes

    public java.util.Iterator childNodes()

### children

    public GPathResult children()

### declareNamespace

    public GPathResult declareNamespace(java.util.Map newNamespaceMapping)

### depthFirst

    public java.util.Iterator depthFirst()

### equals

    public boolean equals(java.lang.Object obj)

### find

    public GPathResult find(Closure closure)

### findAll

    public GPathResult findAll(Closure closure)

### getAt

    public java.lang.Object getAt(int index)

### getAt

    public java.lang.Object getAt(IntRange range)

### getBody

    public Closure getBody()

### getProperty

    public java.lang.Object getProperty(java.lang.String property)

### isEmpty

    public boolean isEmpty()

### iterator

    public java.util.Iterator iterator()

### leftShift

    public java.lang.Object leftShift(java.lang.Object newValue)

### list

    public java.util.List list()

### lookupNamespace

    public java.lang.String lookupNamespace(java.lang.String prefix)

### name

    public java.lang.String name()

### nodeIterator

    public java.util.Iterator nodeIterator()

### parent

    public GPathResult parent()

### parents

    public GPathResult parents()

### plus

    public java.lang.Object plus(java.lang.Object newValue)

### putAt

    public void putAt(int index, java.lang.Object newValue)

### replaceBody

    protected void replaceBody(java.lang.Object newValue)

### replaceNode

    protected void replaceNode(Closure newValue)

### setMetaClass

    @Override
    public void setMetaClass(MetaClass metaClass)

### setProperty

    public void setProperty(java.lang.String property, java.lang.Object newValue)

### size

    public int size()

### text

    public java.lang.String text()

### toBigDecimal

    public java.math.BigDecimal toBigDecimal()

### toBigInteger

    public java.math.BigInteger toBigInteger()

### toBoolean

    public java.lang.Boolean toBoolean()

### toDouble

    public java.lang.Double toDouble()

### toFloat

    public java.lang.Float toFloat()

### toInteger

    public java.lang.Integer toInteger()

### toLong

    public java.lang.Long toLong()

### toString

    public java.lang.String toString()

### toURI

    public java.net.URI toURI()

### toURL

    public java.net.URL toURL()

Groovy Documentation