org.eclipse.jetty.xml

## Class XmlParser.Node

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<Object>
    - - org.eclipse.jetty.xml.XmlParser.Node

- All Implemented Interfaces:
    Iterable<Object>, Collection<Object>, List<Object>
  Enclosing class:
    XmlParser

      public static class XmlParser.Node
      extends AbstractList<Object>

  XML Node. Represents an XML element with optional attributes and ordered content.

- - ### Field Summary

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(int i, Object o)`
    `void` | `clear()`
    `Object` | `get(int i)` Get the ith child node or content.
    `XmlParser.Node` | `get(String tag)` Get the first child node with the tag.
    `String` | `getAttribute(String name)` Get an element attribute.
    `String` | `getAttribute(String name, String dft)` Get an element attribute.
    `XmlParser.Attribute[]` | `getAttributes()` Get an array of element attributes.
    `XmlParser.Node` | `getParent()`
    `String` | `getPath()`
    `String` | `getString(String tag, boolean tags, boolean trim)` Get a tag as a string.
    `String` | `getTag()`
    `Iterator<XmlParser.Node>` | `iterator(String tag)` Iterator over named child nodes.
    `int` | `size()` Get the number of children nodes.
    `String` | `toString()`
    `String` | `toString(boolean tag)` Convert to a string.
    `String` | `toString(boolean tag, boolean trim)` Convert to a string.

    - ### Methods inherited from class java.util.AbstractList

      `add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList`

    - ### Methods inherited from class java.util.AbstractCollection

      `addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.List

      `addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray`

- - ### Method Detail

    - #### getParent

          public XmlParser.Node getParent()

    - #### getTag

          public String getTag()

    - #### getPath

          public String getPath()

    - #### getAttributes

          public XmlParser.Attribute[] getAttributes()

      Get an array of element attributes.

    - #### getAttribute

          public String getAttribute(String name)

      Get an element attribute.
      Returns:
        attribute or null.

    - #### getAttribute

          public String getAttribute(String name,
                            String dft)

      Get an element attribute.
      Returns:
        attribute or null.

    - #### size

          public int size()

      Get the number of children nodes.
      Specified by:
        `size` in interface `Collection<Object>`
      Specified by:
        `size` in interface `List<Object>`
      Specified by:
        `size` in class `AbstractCollection<Object>`

    - #### get

          public Object get(int i)

      Get the ith child node or content.
      Specified by:
        `get` in interface `List<Object>`
      Specified by:
        `get` in class `AbstractList<Object>`
      Returns:
        Node or String.

    - #### get

          public XmlParser.Node get(String tag)

      Get the first child node with the tag.
      Parameters:
        `tag` -
      Returns:
        Node or null.

    - #### add

          public void add(int i,
                 Object o)

      Specified by:
        `add` in interface `List<Object>`
      Overrides:
        `add` in class `AbstractList<Object>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Collection<Object>`
      Specified by:
        `clear` in interface `List<Object>`
      Overrides:
        `clear` in class `AbstractList<Object>`

    - #### getString

          public String getString(String tag,
                         boolean tags,
                         boolean trim)

      Get a tag as a string.
      Parameters:
        `tag` - The tag to get
        `tags` - IF true, tags are included in the value.
        `trim` - If true, trim the value.
      Returns:
        results of get(tag).toString(tags).

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractCollection<Object>`

    - #### toString

          public String toString(boolean tag)

      Convert to a string.
      Parameters:
        `tag` - If false, only _content is shown.

    - #### toString

          public String toString(boolean tag,
                        boolean trim)

      Convert to a string.
      Parameters:
        `tag` - If false, only _content is shown.

    - #### iterator

          public Iterator<XmlParser.Node> iterator(String tag)

      Iterator over named child nodes.
      Parameters:
        `tag` - The tag of the nodes.
      Returns:
        Iterator over all child nodes with the specified tag.

Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.