Class XppDom
- java.lang.Object
-
- com.thoughtworks.xstream.io.xml.xppdom.XppDom
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
Xpp3Dom
public class XppDom extends java.lang.Object implements java.io.Serializable
Simple Document Object Model for XmlPullParser implementations.- Since:
- 1.4
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map
attributes
private java.util.List
childList
private java.util.Map
childMap
private java.lang.String
name
private XppDom
parent
private static long
serialVersionUID
private java.lang.String
value
-
Constructor Summary
Constructors Constructor Description XppDom(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(XppDom xpp3Dom)
static XppDom
build(org.xmlpull.v1.XmlPullParser parser)
Build an XPP DOM hierarchy.java.lang.String
getAttribute(java.lang.String name)
java.lang.String[]
getAttributeNames()
XppDom
getChild(int i)
XppDom
getChild(java.lang.String name)
int
getChildCount()
XppDom[]
getChildren()
XppDom[]
getChildren(java.lang.String name)
java.lang.String
getName()
XppDom
getParent()
java.lang.String
getValue()
(package private) java.lang.Object
readResolve()
void
setAttribute(java.lang.String name, java.lang.String value)
void
setParent(XppDom parent)
void
setValue(java.lang.String value)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
private java.lang.String name
-
value
private java.lang.String value
-
attributes
private java.util.Map attributes
-
childList
private java.util.List childList
-
childMap
private transient java.util.Map childMap
-
parent
private XppDom parent
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getValue
public java.lang.String getValue()
-
setValue
public void setValue(java.lang.String value)
-
getAttributeNames
public java.lang.String[] getAttributeNames()
-
getAttribute
public java.lang.String getAttribute(java.lang.String name)
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.String value)
-
getChild
public XppDom getChild(int i)
-
getChild
public XppDom getChild(java.lang.String name)
-
addChild
public void addChild(XppDom xpp3Dom)
-
getChildren
public XppDom[] getChildren()
-
getChildren
public XppDom[] getChildren(java.lang.String name)
-
getChildCount
public int getChildCount()
-
getParent
public XppDom getParent()
-
setParent
public void setParent(XppDom parent)
-
readResolve
java.lang.Object readResolve()
-
build
public static XppDom build(org.xmlpull.v1.XmlPullParser parser) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
Build an XPP DOM hierarchy. TheInputStream
orReader
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 XMLjava.io.IOException
- if the data cannot be read
-
-