Package: groovy.xml.slurpersupport

## [Java] Class Attribute

- groovy.xml.slurpersupport.Attribute

-     public class Attribute
      extends GPathResult

  Lazy evaluated representation of a node attribute.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class GPathResult` | `name, namespaceMap, namespacePrefix, namespaceTagHints, parent`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Attribute(String name, String value, GPathResult parent, String namespacePrefix, Map<String, String> namespaceTagHints)` Parameters: `name` - of the attribute

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected void` | `appendNode(Object newValue)` NOP, because a node can not be appended to an attribute.
    `` | `public void` | `build(GroovyObject builder)`
    `` | `public Iterator` | `childNodes()` Throws a `GroovyRuntimeException`, because an attribute can have no children.
    `` | `public GPathResult` | `find(Closure closure)`
    `` | `public GPathResult` | `findAll(Closure closure)`
    `` | `public Iterator` | `iterator()`
    `` | `public String` | `name()`
    `` | `public String` | `namespaceURI()` Returns the URI of the namespace of this Attribute.
    `` | `public Iterator` | `nodeIterator()`
    `` | `public GPathResult` | `parents()` Throws a `GroovyRuntimeException`, because this method is not implemented yet.
    `` | `protected void` | `replaceBody(Object newValue)` NOP, because an attribute does not have a Body.
    `` | `protected void` | `replaceNode(Closure newValue)` NOP, because an attribute does not have any Node to replace.
    `` | `public int` | `size()` Returns the size of this Attribute, which is always `1`.
    `` | `public String` | `text()` Returns the value of this Attribute.
    `` | `public Writer` | `writeTo(Writer out)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GPathResult` | `appendNode, breadthFirst, childNodes, children, createIterator, declareNamespace, depthFirst, doCall, doCall, equals, find, findAll, getAt, getAt, getAttribute, getAttribute, getBody, getProperty, hasNext, hasNext, hasNext, hashCode, isEmpty, iterator, leftShift, list, lookupNamespace, name, next, next, next, nodeIterator, parent, parents, plus, plus, pop, putAt, remove, remove, remove, replaceBody, replaceNode, setAttribute, setAttribute, setMetaClass, setProperty, size, text, toBigDecimal, toBigInteger, toBoolean, toDouble, toFloat, toInteger, toLong, toString, toURI, toURL`
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Constructor Detail

    - #### public Attribute(String name, String value, GPathResult parent, String namespacePrefix, Map<String, String> namespaceTagHints)

      Parameters:
        `name` - of the attribute
        `value` - of the attribute
        `parent` - the GPathResult prior to the application of the expression creating this GPathResult
        `namespacePrefix` - the namespace prefix if any
        `namespaceTagHints` - the known tag to namespace mappings

  - ### Method Detail

    - #### @Override
      protected void appendNode(Object newValue)

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

    - #### @Override
      public void build(GroovyObject builder)

    - #### @Override
      public Iterator childNodes()

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

    - #### @Override
      public GPathResult find(Closure closure)

    - #### @Override
      public GPathResult findAll(Closure closure)

    - #### @Override
      public Iterator iterator()

    - #### @Override
      public String name()

    - #### public String namespaceURI()

      Returns the URI of the namespace of this Attribute.

      Returns:
        the namespace of this Attribute

    - #### @Override
      public Iterator nodeIterator()

    - #### @Override
      public GPathResult parents()

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

    - #### @Override
      protected void replaceBody(Object newValue)

      NOP, because an attribute does not have a Body.

    - #### @Override
      protected void replaceNode(Closure newValue)

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

    - #### @Override
      public int size()

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

      Returns:
        `1`

    - #### @Override
      public String text()

      Returns the value of this Attribute.

      Returns:
        the value of this Attribute

    - #### @Override
      public Writer writeTo(Writer out)