Top Description Fields Constructors Methods
groovy.util.slurpersupport

public Class Attributes

extends NodeChildren
Class Inheritance
Known Direct Subclasses
groovy.util.slurpersupport.FilteredAttributes
Annotations
@Deprecated
Imports
groovy.lang.Closure, .GroovyObject, .GroovyRuntimeException, groovy.xml.QName, java.io.IOException, .Writer, java.util.ArrayList, .Iterator, .List, .Map

Deprecated

Lazy evaluated representation of a node's attributes.

Field Summary

Modifier and TypeField and Description
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
Attributes(final GPathResult
the GPathResult prior to the application of the expression creating this GPathResult
parent
,
final String
if the GPathResult corresponds to something with a name, e.g. a node
name
,
final String
the namespace prefix if any
namespacePrefix
,
final Map<String, String>
the known tag to namespace mappings
namespaceTagHints
)

Deprecated as a consequence of GPathResult being deprecated.
public
Attributes(final GPathResult
the GPathResult prior to the application of the expression creating this GPathResult
parent
,
final String
if the GPathResult corresponds to something with a name, e.g. a node
name
,
final Map<String, String>
the known tag to namespace mappings
namespaceTagHints
)

Deprecated as a consequence of GPathResult being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
public Iterator<E>
childNodes()

Overrides groovy.util.slurpersupport.NodeChildren.childNodes.

Throws a GroovyRuntimeException, because attributes can have no children.
public GPathResult
findAll(final Closure<V>
a closure to filters the children of this GPathResult
closure
)

Overrides groovy.util.slurpersupport.NodeChildren.findAll.

Deprecated as a consequence of GPathResult being deprecated.
Returns the children of this GPathResult matching the condition(s) specified in the passed closure.
public Iterator<E>
iterator()

Overrides groovy.util.slurpersupport.NodeChildren.iterator.

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public List<E>
list()

Overrides groovy.util.slurpersupport.GPathResult.list.

Creates a list of objects representing this GPathResult.
public String
name()

Overrides groovy.util.slurpersupport.GPathResult.name.

Returns the name of this GPathResult.
public Iterator<E>
public GPathResult
parents()

Overrides groovy.util.slurpersupport.NodeChildren.parents.

Deprecated as a consequence of GPathResult being deprecated.
Throws a GroovyRuntimeException, because it is not implemented yet.
public String
text()

Overrides groovy.util.slurpersupport.NodeChildren.text.

Returns the text of this GPathResult as a String.
public Writer
writeTo(final Writer
the Writer to which this Writable should output its data.
out
)

Overrides groovy.util.slurpersupport.NodeChildren.writeTo.

Implements groovy.lang.Writable.writeTo.

Writes this object to the given writer.
Inherited from groovy.util.slurpersupport.NodeChildren:
appendNodefindreplaceBodyreplaceNodesize

Field Detail

attributeNameback to summary
pack-priv final String attributeName

Constructor Detail

Attributesback to summary
public Attributes(final GPathResult parent, final String name, final String namespacePrefix, final Map<String, String> namespaceTagHints)

Deprecated

as a consequence of GPathResult being deprecated. See corresponding docs for further information.

Parameters
parent:GPathResult

the GPathResult prior to the application of the expression creating this GPathResult

name:String

if the GPathResult corresponds to something with a name, e.g. a node

namespacePrefix:String

the namespace prefix if any

namespaceTagHints:Map<String, String>

the known tag to namespace mappings

Attributesback to summary
public Attributes(final GPathResult parent, final String name, final Map<String, String> namespaceTagHints)

Deprecated

as a consequence of GPathResult being deprecated. See corresponding docs for further information.

Parameters
parent:GPathResult

the GPathResult prior to the application of the expression creating this GPathResult

name:String

if the GPathResult corresponds to something with a name, e.g. a node

namespaceTagHints:Map<String, String>

the known tag to namespace mappings

Method Detail

buildback to summary
public void build(final GroovyObject builder)

Overrides groovy.util.slurpersupport.NodeChildren.build.

Implements groovy.lang.Buildable.build.

childNodesback to summary
public Iterator<E> childNodes()

Overrides groovy.util.slurpersupport.NodeChildren.childNodes.

Throws a GroovyRuntimeException, because attributes can have no children.

Returns:Iterator<E>

Doc from groovy.util.slurpersupport.GPathResult.childNodes.

an iterator over the child nodes of this GPathResult

findAllback to summary
public GPathResult findAll(final Closure<V> closure)

Overrides groovy.util.slurpersupport.NodeChildren.findAll.

Doc from groovy.util.slurpersupport.GPathResult.findAll.

Deprecated

as a consequence of GPathResult being deprecated. See corresponding docs for further information.

Returns the children of this GPathResult matching the condition(s) specified in the passed closure.

Parameters
closure:Closure<V>

a closure to filters the children of this GPathResult

Returns:GPathResult

the children matching the closure

iteratorback to summary
public Iterator<E> iterator()

Overrides groovy.util.slurpersupport.NodeChildren.iterator.

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<E>

an Iterator.

listback to summary
public List<E> list()

Overrides groovy.util.slurpersupport.GPathResult.list.

Doc from groovy.util.slurpersupport.GPathResult.list.

Creates a list of objects representing this GPathResult.

Returns:List<E>

a list representing of this GPathResult

nameback to summary
public String name()

Overrides groovy.util.slurpersupport.GPathResult.name.

Doc from groovy.util.slurpersupport.GPathResult.name.

Returns the name of this GPathResult.

Returns:String

the name of this GPathResult

nodeIteratorback to summary
public Iterator<E> nodeIterator()

Overrides groovy.util.slurpersupport.NodeChildren.nodeIterator.

parentsback to summary
public GPathResult parents()

Overrides groovy.util.slurpersupport.NodeChildren.parents.

Doc from groovy.util.slurpersupport.NodeChildren.parents.

Deprecated

as a consequence of GPathResult being deprecated. See corresponding docs for further information.

Throws a GroovyRuntimeException, because it is not implemented yet.

Returns:GPathResult

Doc from groovy.util.slurpersupport.GPathResult.parents.

the parents of this GPathResult

textback to summary
public String text()

Overrides groovy.util.slurpersupport.NodeChildren.text.

Doc from groovy.util.slurpersupport.GPathResult.text.

Returns the text of this GPathResult as a String.

Returns:String

the text of this GPathResult

writeToback to summary
public Writer writeTo(final Writer out) throws IOException

Overrides groovy.util.slurpersupport.NodeChildren.writeTo.

Implements groovy.lang.Writable.writeTo.

Doc from groovy.lang.Writable.writeTo.

Writes this object to the given writer.

This is used to defer content creation until the point when it is streamed to the output destination. Oftentimes, content will be defined but not necessarily created (as is may be the case with a Closure definition.) In that case, the output is then 'deferred' to the point when it is serialized to the writer. This class may be used whenever an object should be responsible for creating its own textual representation, but creating the entire output as a single String would be inefficient (such as outputting a multi-gigabyte XML document.)

Parameters
out:Writer

the Writer to which this Writable should output its data.

Returns:Writer

the Writer that was passed

Exceptions
IOException:
if an error occurred while outputting data to the writer