com.thoughtworks.xstream.io.xml.xppdom
Class XppDom

java.lang.Object
  extended by com.thoughtworks.xstream.io.xml.xppdom.XppDom
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Xpp3Dom

public class XppDom
extends Object
implements Serializable

Simple Document Object Model for XmlPullParser implementations.

Since:
1.4
Author:
Jason van Zyl, Joe Walnes, Jörg Schaible
See Also:
Serialized Form

Constructor Summary
XppDom(String name)
           
 
Method Summary
 void addChild(XppDom xpp3Dom)
           
static XppDom build(org.xmlpull.v1.XmlPullParser parser)
          Build an XPP DOM hierarchy.
 String getAttribute(String name)
           
 String[] getAttributeNames()
           
 XppDom getChild(int i)
           
 XppDom getChild(String name)
           
 int getChildCount()
           
 XppDom[] getChildren()
           
 XppDom[] getChildren(String name)
           
 String getName()
           
 XppDom getParent()
           
 String getValue()
           
 void setAttribute(String name, String value)
           
 void setParent(XppDom parent)
           
 void setValue(String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XppDom

public XppDom(String name)
Method Detail

getName

public String getName()

getValue

public String getValue()

setValue

public void setValue(String value)

getAttributeNames

public String[] getAttributeNames()

getAttribute

public String getAttribute(String name)

setAttribute

public void setAttribute(String name,
                         String value)

getChild

public XppDom getChild(int i)

getChild

public XppDom getChild(String name)

addChild

public void addChild(XppDom xpp3Dom)

getChildren

public XppDom[] getChildren()

getChildren

public XppDom[] getChildren(String name)

getChildCount

public int getChildCount()

getParent

public XppDom getParent()

setParent

public void setParent(XppDom parent)

build

public static XppDom build(org.xmlpull.v1.XmlPullParser parser)
                    throws org.xmlpull.v1.XmlPullParserException,
                           IOException
Build an XPP DOM hierarchy. The InputStream or Reader used by the parser must have already been set. The method does not close it after reading the document's end.

Parameters:
parser - the XPP instance
Throws:
org.xmlpull.v1.XmlPullParserException - if the parser turns into an invalid state or reads invalid XML
IOException - if the data cannot be read


Copyright © 2004-2014 XStream. All Rights Reserved.