Package groovy.util.slurpersupport
Class GPathResult
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.slurpersupport.GPathResult
- All Implemented Interfaces:
Buildable,GroovyObject,Writable
- Direct Known Subclasses:
Attribute,FilteredAttributes,FilteredNodeChildren,NoChildren,NodeChild
Base class for representing lazy evaluated GPath expressions.
- Author:
- John Wilson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Mapprotected final Stringprotected final GPathResult -
Constructor Summary
ConstructorsConstructorDescriptionGPathResult(GPathResult parent, String name, String namespacePrefix, Map<String, String> namespaceTagHints) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidappendNode(Object newValue) An iterator useful for traversing XML documents/fragments in breadth-first order.abstract Iteratorchildren()declareNamespace(Map newNamespaceMapping) booleanabstract GPathResultabstract GPathResultgetAt(int index) getBody()getProperty(String property) Retrieves a property value.booleanisEmpty()abstract Iteratoriterator()list()lookupNamespace(String prefix) name()abstract Iteratorparent()abstract GPathResultparents()voidprotected abstract voidreplaceBody(Object newValue) protected abstract voidreplaceNode(Closure newValue) voidsetMetaClass(MetaClass metaClass) Allows the MetaClass to be replaced with a derived implementation.voidsetProperty(String property, Object newValue) Sets the given property to the new value.abstract intsize()abstract Stringtext()toDouble()toFloat()toLong()toString()toURI()toURL()Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod
-
Field Details
-
parent
-
name
-
namespacePrefix
-
namespaceMap
-
namespaceTagHints
-
-
Constructor Details
-
GPathResult
public GPathResult(GPathResult parent, String name, String namespacePrefix, Map<String, String> namespaceTagHints) - Parameters:
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 mappings
-
-
Method Details
-
setMetaClass
Description copied from interface:GroovyObjectAllows the MetaClass to be replaced with a derived implementation.- Specified by:
setMetaClassin interfaceGroovyObject- Overrides:
setMetaClassin classGroovyObjectSupport- Parameters:
metaClass- the new metaclass
-
getProperty
Description copied from interface:GroovyObjectRetrieves a property value.- Specified by:
getPropertyin interfaceGroovyObject- Overrides:
getPropertyin classGroovyObjectSupport- Parameters:
property- the name of the property of interest- Returns:
- the given property
-
setProperty
Description copied from interface:GroovyObjectSets the given property to the new value.- Specified by:
setPropertyin interfaceGroovyObject- Overrides:
setPropertyin classGroovyObjectSupport- Parameters:
property- the name of the property of interestnewValue- the new value for the property
-
leftShift
-
plus
-
replaceNode
-
replaceBody
-
appendNode
-
name
-
parent
-
children
-
lookupNamespace
-
toString
-
toInteger
-
toLong
-
toFloat
-
toDouble
-
toBigDecimal
-
toBigInteger
-
toURL
- Throws:
MalformedURLException
-
toURI
- Throws:
URISyntaxException
-
toBoolean
-
declareNamespace
-
equals
-
getAt
-
getAt
-
putAt
-
depthFirst
-
breadthFirst
An iterator useful for traversing XML documents/fragments in breadth-first order.- Returns:
- Iterator the iterator of GPathResult objects
-
list
-
isEmpty
public boolean isEmpty() -
getBody
-
size
public abstract int size() -
text
-
parents
-
childNodes
-
iterator
-
find
-
findAll
-
nodeIterator
-