Package org.apache.hadoop.hdfs.util
Class XMLUtils.Stanza
java.lang.Object
org.apache.hadoop.hdfs.util.XMLUtils.Stanza
- Enclosing class:
- XMLUtils
Represents a bag of key-value pairs encountered during parsing an XML
file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(String name, XMLUtils.Stanza child) Add an entry to a stanza.getChildren(String name) Pull an entry from a stanza.getValue()Pull a string entry from a stanza.getValueOrNull(String name) Pull a string entry from a stanza, or null.booleanhasChildren(String name) Discover if a stanza has a given entry.voidtoString()Convert a stanza to a human-readable string.
-
Constructor Details
-
Stanza
public Stanza()
-
-
Method Details
-
setValue
-
getValue
-
hasChildren
Discover if a stanza has a given entry.- Parameters:
name- entry to look for- Returns:
- true if the entry was found
-
getChildren
Pull an entry from a stanza.- Parameters:
name- entry to look for- Returns:
- the entry
- Throws:
XMLUtils.InvalidXmlException
-
getValue
Pull a string entry from a stanza.- Parameters:
name- entry to look for- Returns:
- the entry
- Throws:
XMLUtils.InvalidXmlException
-
getValueOrNull
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
Add an entry to a stanza.- Parameters:
name- name of the entry to addchild- the entry to add
-
toString
Convert a stanza to a human-readable string.
-