Top Description Fields Constructors Methods
groovy.util.slurpersupport

public Class Attribute

extends GPathResult
Class Inheritance
Annotations
@Deprecated
Imports
groovy.lang.Closure, .GroovyObject, .GroovyRuntimeException, org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation, java.io.IOException, .Writer, java.util.Iterator, .Map

Deprecated

Lazy evaluated representation of a node attribute.

Field Summary

Modifier and TypeField and Description
private final String
Inherited from groovy.util.slurpersupport.GPathResult:
namenamespaceMapnamespacePrefixnamespaceTagHintsparent

Constructor Summary

AccessConstructor and Description
public
Attribute(final String
of the attribute
name
,
final String
of the attribute
value
,
final GPathResult
the GPathResult prior to the application of the expression creating this GPathResult
parent
,
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.

Method Summary

Modifier and TypeMethod and Description
protected void
appendNode(final Object newValue)

Implements abstract groovy.util.slurpersupport.GPathResult.appendNode.

NOP, because an node can not be appended to an attribute.
public void
public Iterator<E>
childNodes()

Implements abstract groovy.util.slurpersupport.GPathResult.childNodes.

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

Implements abstract groovy.util.slurpersupport.GPathResult.find.

Deprecated as a consequence of GPathResult being deprecated.
Returns the first child of this GPathResult matching the condition(s) specified in the passed closure.
public GPathResult
findAll(final Closure<V>
a closure to filters the children of this GPathResult
closure
)

Implements abstract groovy.util.slurpersupport.GPathResult.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()

Implements abstract groovy.util.slurpersupport.GPathResult.iterator.

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public String
name()

Overrides groovy.util.slurpersupport.GPathResult.name.

Returns the name of this GPathResult.
public String

Returns:

the namespace of this Attribute
namespaceURI
()

Returns the URI of the namespace of this Attribute.

public Iterator<E>
public GPathResult
parents()

Implements abstract groovy.util.slurpersupport.GPathResult.parents.

Deprecated as a consequence of GPathResult being deprecated.
Throws a GroovyRuntimeException, because this method is not implemented yet.
protected void
replaceBody(final Object newValue)

Implements abstract groovy.util.slurpersupport.GPathResult.replaceBody.

NOP, because an attribute does not have a Body.
protected void
replaceNode(final Closure<V> newValue)

Implements abstract groovy.util.slurpersupport.GPathResult.replaceNode.

NOP, because an attribute does not have any Node to replace.
public int

Returns:

1
size
()

Implements abstract groovy.util.slurpersupport.GPathResult.size.

Returns the size of this Attribute, which is always 1.
public String

Returns:

the value of this Attribute
text
()

Implements abstract groovy.util.slurpersupport.GPathResult.text.

Returns the value of this Attribute.
public Writer
writeTo(final Writer
the Writer to which this Writable should output its data.
out
)

Implements groovy.lang.Writable.writeTo.

Writes this object to the given writer.
Inherited from groovy.util.slurpersupport.GPathResult:
breadthFirstchildrencreateIteratordeclareNamespacedepthFirstequalsgetAtgetAtgetBodygetPropertyhashCodeisEmptyleftShiftlistlookupNamespaceparentpluspopputAtsetMetaClasssetPropertytoBigDecimaltoBigIntegertoBooleantoDoubletoFloattoIntegertoLongtoStringtoURItoURL

Field Detail

valueback to summary
private final String value

Constructor Detail

Attributeback to summary
public Attribute(final String name, final String value, final GPathResult parent, final String namespacePrefix, final Map<String, String> namespaceTagHints)

Deprecated

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

Parameters
name:String

of the attribute

value:String

of the attribute

parent:GPathResult

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

namespacePrefix:String

the namespace prefix if any

namespaceTagHints:Map<String, String>

the known tag to namespace mappings

Method Detail

appendNodeback to summary
protected void appendNode(final Object newValue)

Implements abstract groovy.util.slurpersupport.GPathResult.appendNode.

NOP, because an node can not be appended to an attribute.

buildback to summary
public void build(final GroovyObject builder)

Implements groovy.lang.Buildable.build.

childNodesback to summary
public Iterator<E> childNodes()

Implements abstract groovy.util.slurpersupport.GPathResult.childNodes.

Throws a GroovyRuntimeException, because an attribute can have no children.

Returns:Iterator<E>

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

an iterator over the child nodes of this GPathResult

findback to summary
public GPathResult find(final Closure<V> closure)

Implements abstract groovy.util.slurpersupport.GPathResult.find.

Doc from groovy.util.slurpersupport.GPathResult.find.

Deprecated

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

Returns the first child 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 first child matching the closure

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

Implements abstract groovy.util.slurpersupport.GPathResult.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()

Implements abstract groovy.util.slurpersupport.GPathResult.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.

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

namespaceURIback to summary
public String namespaceURI()

Returns the URI of the namespace of this Attribute.

Returns:String

the namespace of this Attribute

nodeIteratorback to summary
public Iterator<E> nodeIterator()

Implements abstract groovy.util.slurpersupport.GPathResult.nodeIterator.

parentsback to summary
public GPathResult parents()

Implements abstract groovy.util.slurpersupport.GPathResult.parents.

Deprecated

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

Throws a GroovyRuntimeException, because this method is not implemented yet.

Returns:GPathResult

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

the parents of this GPathResult

replaceBodyback to summary
protected void replaceBody(final Object newValue)

Implements abstract groovy.util.slurpersupport.GPathResult.replaceBody.

NOP, because an attribute does not have a Body.

replaceNodeback to summary
protected void replaceNode(final Closure<V> newValue)

Implements abstract groovy.util.slurpersupport.GPathResult.replaceNode.

NOP, because an attribute does not have any Node to replace.

sizeback to summary
public int size()

Implements abstract groovy.util.slurpersupport.GPathResult.size.

Returns the size of this Attribute, which is always 1.

Returns:int

1

textback to summary
public String text()

Implements abstract groovy.util.slurpersupport.GPathResult.text.

Returns the value of this Attribute.

Returns:String

the value of this Attribute

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

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