org.apache.hadoop.hdfs.util
Class XMLUtils.Stanza

java.lang.Object
  extended by org.apache.hadoop.hdfs.util.XMLUtils.Stanza
Enclosing class:
org.apache.hadoop.hdfs.util.XMLUtils

public static class XMLUtils.Stanza
extends Object

Represents a bag of key-value pairs encountered during parsing an XML file.


Constructor Summary
XMLUtils.Stanza()
           
 
Method Summary
 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.
 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 Detail

XMLUtils.Stanza

public XMLUtils.Stanza()
Method Detail

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

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


Copyright © 2013 Apache Software Foundation. All Rights Reserved.