Package groovy.xml.slurpersupport
Class NoChildren
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.xml.slurpersupport.GPathResult
groovy.xml.slurpersupport.NoChildren
- All Implemented Interfaces:
groovy.lang.Buildable,groovy.lang.GroovyObject,groovy.lang.Writable,Iterable
public class NoChildren extends GPathResult
Lazy evaluated representation of a GPath expression returning no children.
As this class represents a GPath expression with no results, all methods
are either NOPs or return an empty result.
-
Field Summary
Fields inherited from class groovy.xml.slurpersupport.GPathResult
name, namespaceMap, namespacePrefix, namespaceTagHints, parent -
Constructor Summary
Constructors Constructor Description NoChildren(GPathResult parent, String name, Map<String,String> namespaceTagHints) -
Method Summary
Modifier and Type Method Description protected voidappendNode(Object newValue)NOPbooleanasBoolean()Returnsfalse.voidbuild(groovy.lang.GroovyObject builder)NOPIteratorchildNodes()Returns an emptyIterator.GPathResultfind(groovy.lang.Closure closure)Returnsthis.GPathResultfindAll(groovy.lang.Closure closure)Returnsthis.Iteratoriterator()Returns an emptyIterator.IteratornodeIterator()Returns an empty iterator.GPathResultparents()Throws aGroovyRuntimeException, because it is not implemented yet.protected voidreplaceBody(Object newValue)NOPprotected voidreplaceNode(groovy.lang.Closure newValue)NOPintsize()Returns0.Stringtext()Returns an emptyString.WriterwriteTo(Writer out)Does not write any output, just returns the writer.Methods inherited from class groovy.xml.slurpersupport.GPathResult
breadthFirst, children, createIterator, declareNamespace, depthFirst, equals, getAt, getAt, getBody, getProperty, hashCode, isEmpty, leftShift, list, lookupNamespace, name, parent, plus, pop, putAt, setMetaClass, setProperty, toBigDecimal, toBigInteger, toBoolean, toDouble, toFloat, toInteger, toLong, toString, toURI, toURLMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClassMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface groovy.lang.GroovyObject
invokeMethodMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
NoChildren
- 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 nodenamespaceTagHints- the known tag to namespace mappings
-
-
Method Details
-
size
public int size()Returns0.- Specified by:
sizein classGPathResult- Returns:
0
-
text
Returns an emptyString.- Specified by:
textin classGPathResult- Returns:
- an empty
String
-
parents
Throws aGroovyRuntimeException, because it is not implemented yet.- Specified by:
parentsin classGPathResult- Returns:
- the parents of this GPathResult
-
childNodes
Returns an emptyIterator.- Specified by:
childNodesin classGPathResult- Returns:
- an empty
Iterator
-
iterator
Returns an emptyIterator.- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin classGPathResult- Returns:
- an empty
Iterator
-
find
Returnsthis.- Specified by:
findin classGPathResult- Parameters:
closure- a closure to filters the children of this GPathResult- Returns:
this
-
findAll
Returnsthis.- Specified by:
findAllin classGPathResult- Parameters:
closure- a closure to filters the children of this GPathResult- Returns:
this
-
nodeIterator
Returns an empty iterator.- Specified by:
nodeIteratorin classGPathResult- Returns:
- an empty iterator
-
writeTo
Does not write any output, just returns the writer.- Returns:
- the
Writerwhich was passed in - Throws:
IOException
-
build
public void build(groovy.lang.GroovyObject builder)NOP -
replaceNode
protected void replaceNode(groovy.lang.Closure newValue)NOP- Specified by:
replaceNodein classGPathResult
-
replaceBody
NOP- Specified by:
replaceBodyin classGPathResult
-
appendNode
NOP- Specified by:
appendNodein classGPathResult
-
asBoolean
public boolean asBoolean()Returnsfalse.- Returns:
false
-