XMLUtils.Stanza (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.util, class: XMLUtils, class: Stanza

Package org.apache.hadoop.hdfs.util

# Class XMLUtils.Stanza

java.lang.Object
org.apache.hadoop.hdfs.util.XMLUtils.Stanza

Enclosing class:
  XMLUtils

public static class XMLUtils.Stanza extends Object
Represents a bag of key-value pairs encountered during parsing an XML file.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Stanza()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addChild(String name, XMLUtils.Stanza child)`
  Add an entry to a stanza.
  `List<XMLUtils.Stanza>`
  `getChildren(String name)`
  Pull an entry from a stanza.
  `String`
  `getValue()`
  `String`
  `getValue(String name)`
  Pull a string entry from a stanza.
  `String`
  `getValueOrNull(String name)`
  Pull a string entry from a stanza, or null.
  `boolean`
  `hasChildren(String name)`
  Discover if a stanza has a given entry.
  `void`
  `setValue(String value)`
  `String`
  `toString()`
  Convert a stanza to a human-readable string.

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

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

- ## Constructor Details

  - ### Stanza

    public Stanza()

- ## Method Details

  - ### setValue

    public void setValue(String value)

  - ### getValue

    public String getValue()

  - ### hasChildren

    public boolean hasChildren(String name)
    Discover if a stanza has a given entry.
    Parameters:
      `name` - entry to look for
    Returns:
      true if the entry was found

  - ### getChildren

    public List<XMLUtils.Stanza> getChildren(String name) throws XMLUtils.InvalidXmlException
    Pull an entry from a stanza.
    Parameters:
      `name` - entry to look for
    Returns:
      the entry
    Throws:
      `XMLUtils.InvalidXmlException`

  - ### getValue

    public String getValue(String name) throws XMLUtils.InvalidXmlException
    Pull a string entry from a stanza.
    Parameters:
      `name` - entry to look for
    Returns:
      the entry
    Throws:
      `XMLUtils.InvalidXmlException`

  - ### getValueOrNull

    public String getValueOrNull(String name) throws XMLUtils.InvalidXmlException
    Pull a string entry from a stanza, or null.
    Parameters:
      `name` - entry to look for
    Returns:
      the entry, or null if it was not found.
    Throws:
      `XMLUtils.InvalidXmlException`

  - ### addChild

    public void addChild(String name, XMLUtils.Stanza child)
    Add an entry to a stanza.
    Parameters:
      `name` - name of the entry to add
      `child` - the entry to add

  - ### toString

    public String toString()
    Convert a stanza to a human-readable string.
    Overrides:
      `toString` in class `Object`