FileDocCategorySizeDatePackage
SmilXmlParser.javaAPI DocAndroid 1.5 API2597Wed May 06 22:42:46 BST 2009com.android.mms.dom.smil.parser

SmilXmlParser

public class SmilXmlParser extends Object

Fields Summary
private XMLReader
mXmlReader
private com.android.mms.dom.smil.parser.SmilContentHandler
mContentHandler
Constructors Summary
public SmilXmlParser()

        //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 SmilContentHandler();
            mXmlReader.setContentHandler(mContentHandler);
        } catch (SAXException e) {
            throw new MmsException(e);
        }
    
Methods Summary
public org.w3c.dom.smil.SMILDocumentparse(java.io.InputStream in)

        mContentHandler.reset();

        mXmlReader.parse(new InputSource(in));

        SMILDocument doc = mContentHandler.getSmilDocument();
        validateDocument(doc);

        return doc;
    
private voidvalidateDocument(org.w3c.dom.smil.SMILDocument doc)

        /*
         * Calling getBody() will create "smil", "head", and "body" elements if they
         * are not present. It will also initialize the SequentialTimeElementContainer
         * member of SMILDocument, which could not be set on creation of the document.
         * @see com.android.mms.dom.smil.SmilDocumentImpl#getBody()
         */
        doc.getBody();

        /*
         * Calling getLayout() will create "layout" element if it is not present.
         * @see com.android.mms.dom.smil.SmilDocumentImpl#getLayout()
         */
        doc.getLayout();