FileDocCategorySizeDatePackage
XmlPrimitiveParser.javaAPI DocAndroid 1.5 API1942Wed May 06 22:42:46 BST 2009com.android.im.imps

XmlPrimitiveParser

public class XmlPrimitiveParser extends Object implements PrimitiveParser

Fields Summary
private XMLReader
mXmlReader
private PrimitiveContentHandler
mContentHandler
Constructors Summary
public XmlPrimitiveParser()

        //FIXME: Now we don't have the SAXParser wrapped inside,
        //       use the Driver class temporarily.
        System.setProperty("org.xml.sax.driver", "org.xmlpull.v1.sax2.Driver");

        try {
            mXmlReader = XMLReaderFactory.createXMLReader();
            mContentHandler = new PrimitiveContentHandler();
            mXmlReader.setContentHandler(mContentHandler);
        } catch (SAXException e) {
            throw new ImException(e);
        }
    
Methods Summary
public Primitiveparse(java.io.InputStream in)

        mContentHandler.reset();

        try {
            mXmlReader.parse(new InputSource(in));
        } catch (SAXException e) {
            throw new ParserException(e);
        }

        return mContentHandler.getPrimitive();