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

java.lang.Object
  extended by com.thoughtworks.xstream.io.xml.xppdom.XppFactory

public class XppFactory
extends Object

XmlPullParser utility methods.

Since:
1.4.1
Author:
Jörg Schaible

Constructor Summary
XppFactory()
           
 
Method Summary
static XppDom buildDom(InputStream in, String encoding)
          Build an XPP DOM hierarchy from an InputStream.
static XppDom buildDom(Reader r)
          Build an XPP DOM hierarchy from a Reader.
static XppDom buildDom(String xml)
          Build an XPP DOM hierarchy from a String.
static org.xmlpull.v1.XmlPullParser createDefaultParser()
          Create a new XmlPullParser using the XPP factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XppFactory

public XppFactory()
Method Detail

createDefaultParser

public static org.xmlpull.v1.XmlPullParser createDefaultParser()
                                                        throws org.xmlpull.v1.XmlPullParserException
Create a new XmlPullParser using the XPP factory.

Returns:
a new parser instance
Throws:
org.xmlpull.v1.XmlPullParserException - if the factory fails
Since:
1.4.1

buildDom

public static XppDom buildDom(String xml)
                       throws org.xmlpull.v1.XmlPullParserException,
                              IOException
Build an XPP DOM hierarchy from a String.

Parameters:
xml - the XML data
Throws:
org.xmlpull.v1.XmlPullParserException - if the default parser cannot be created or fails with invalid XML
IOException - if the data cannot be read
Since:
1.4.1
See Also:
XppDom.build(XmlPullParser)

buildDom

public static XppDom buildDom(Reader r)
                       throws org.xmlpull.v1.XmlPullParserException,
                              IOException
Build an XPP DOM hierarchy from a Reader.

Parameters:
r - the reader
Throws:
org.xmlpull.v1.XmlPullParserException - if the default parser cannot be created or fails with invalid XML
IOException - if the data cannot be read
Since:
1.4.1
See Also:
XppDom.build(XmlPullParser)

buildDom

public static XppDom buildDom(InputStream in,
                              String encoding)
                       throws org.xmlpull.v1.XmlPullParserException,
                              IOException
Build an XPP DOM hierarchy from an InputStream.

Parameters:
in - the input stream
encoding - the encoding of the input stream
Throws:
org.xmlpull.v1.XmlPullParserException - if the default parser cannot be created or fails with invalid XML
IOException - if the data cannot be read
Since:
1.4.1
See Also:
XppDom.build(XmlPullParser)


Copyright © 2004-2014 XStream. All Rights Reserved.