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

SmilContentHandler

public class SmilContentHandler extends DefaultHandler

Fields Summary
private static final String
TAG
private static final boolean
DEBUG
private static final boolean
LOCAL_LOGV
private org.w3c.dom.smil.SMILDocument
mSmilDocument
private Node
mCurrentNode
Constructors Summary
Methods Summary
public voidcharacters(char[] ch, int start, int length)

        if (LOCAL_LOGV) {
            Log.v(TAG, "SmilContentHandler.characters. ch = " + new String(ch, start, length));
        }
    
public voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)

        if (LOCAL_LOGV) {
            Log.v(TAG, "SmilContentHandler.endElement. localName " + localName);
        }
        mCurrentNode = mCurrentNode.getParentNode();
    
public org.w3c.dom.smil.SMILDocumentgetSmilDocument()
Returns the SMILDocument.

return
The SMILDocument instance

        return mSmilDocument;
    
public voidreset()
Resets this handler.


            
       
        mSmilDocument = new SmilDocumentImpl();
        mCurrentNode = mSmilDocument;
    
public voidstartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)

        if (LOCAL_LOGV) {
            Log.v(TAG, "SmilContentHandler.startElement. Creating element " + localName);
        }
        Element element = mSmilDocument.createElement(localName);
        if (attributes != null) {
            for (int i = 0; i < attributes.getLength(); i++) {
                if (LOCAL_LOGV) {
                    Log.v(TAG, "Attribute " + i +
                        " lname = " + attributes.getLocalName(i) +
                        " value = " + attributes.getValue(i));
                }
                element.setAttribute(attributes.getLocalName(i),
                        attributes.getValue(i));
            }
        }
        if (LOCAL_LOGV) {
            Log.v(TAG, "Appending " + localName + " to " + mCurrentNode.getNodeName());
        }
        mCurrentNode.appendChild(element);

        mCurrentNode = element;