Class GPathResult

    • Field Detail

      • name

        protected final java.lang.String name
      • namespacePrefix

        protected final java.lang.String namespacePrefix
      • namespaceMap

        protected final java.util.Map namespaceMap
      • namespaceTagHints

        protected final java.util.Map<java.lang.String,​java.lang.String> namespaceTagHints
    • Constructor Detail

      • GPathResult

        public GPathResult​(GPathResult parent,
                           java.lang.String name,
                           java.lang.String namespacePrefix,
                           java.util.Map<java.lang.String,​java.lang.String> 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

      • getProperty

        public java.lang.Object getProperty​(java.lang.String property)
        Description copied from interface: GroovyObject
        Retrieves a property value.
        Specified by:
        getProperty in interface GroovyObject
        Overrides:
        getProperty in class GroovyObjectSupport
        Parameters:
        property - the name of the property of interest
        Returns:
        the given property
      • setProperty

        public void setProperty​(java.lang.String property,
                                java.lang.Object newValue)
        Description copied from interface: GroovyObject
        Sets the given property to the new value.
        Specified by:
        setProperty in interface GroovyObject
        Overrides:
        setProperty in class GroovyObjectSupport
        Parameters:
        property - the name of the property of interest
        newValue - the new value for the property
      • leftShift

        public java.lang.Object leftShift​(java.lang.Object newValue)
      • plus

        public java.lang.Object plus​(java.lang.Object newValue)
      • replaceNode

        protected abstract void replaceNode​(Closure newValue)
      • replaceBody

        protected abstract void replaceBody​(java.lang.Object newValue)
      • appendNode

        protected abstract void appendNode​(java.lang.Object newValue)
      • name

        public java.lang.String name()
      • lookupNamespace

        public java.lang.String lookupNamespace​(java.lang.String prefix)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toInteger

        public java.lang.Integer toInteger()
      • toLong

        public java.lang.Long toLong()
      • toFloat

        public java.lang.Float toFloat()
      • toDouble

        public java.lang.Double toDouble()
      • toBigDecimal

        public java.math.BigDecimal toBigDecimal()
      • toBigInteger

        public java.math.BigInteger toBigInteger()
      • toURL

        public java.net.URL toURL()
                           throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • toURI

        public java.net.URI toURI()
                           throws java.net.URISyntaxException
        Throws:
        java.net.URISyntaxException
      • toBoolean

        public java.lang.Boolean toBoolean()
      • declareNamespace

        public GPathResult declareNamespace​(java.util.Map newNamespaceMapping)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getAt

        public java.lang.Object getAt​(int index)
      • getAt

        public java.lang.Object getAt​(IntRange range)
      • putAt

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

        public java.util.Iterator depthFirst()
      • 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
      • list

        public java.util.List list()
      • isEmpty

        public boolean isEmpty()
      • getBody

        public Closure getBody()
      • size

        public abstract int size()
      • text

        public abstract java.lang.String text()
      • childNodes

        public abstract java.util.Iterator childNodes()
      • iterator

        public abstract java.util.Iterator iterator()
      • nodeIterator

        public abstract java.util.Iterator nodeIterator()