/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  javax.xml.transform.sax.SAXResult
 *  org.xml.sax.ContentHandler
 *  org.xml.sax.ext.LexicalHandler
 */
package org.dom4j.io;

import javax.xml.transform.sax.SAXResult;
import org.dom4j.Document;
import org.dom4j.io.SAXContentHandler;
import org.xml.sax.ContentHandler;
import org.xml.sax.ext.LexicalHandler;

public class DocumentResult
extends SAXResult {
    private SAXContentHandler contentHandler;

    public DocumentResult() {
        this(new SAXContentHandler());
    }

    public DocumentResult(SAXContentHandler sAXContentHandler) {
        this.contentHandler = sAXContentHandler;
        super.setHandler((ContentHandler)this.contentHandler);
        super.setLexicalHandler((LexicalHandler)this.contentHandler);
    }

    public Document getDocument() {
        return this.contentHandler.getDocument();
    }

    public void setHandler(ContentHandler contentHandler) {
        if (contentHandler instanceof SAXContentHandler) {
            this.contentHandler = (SAXContentHandler)contentHandler;
            super.setHandler((ContentHandler)this.contentHandler);
        }
    }

    public void setLexicalHandler(LexicalHandler lexicalHandler) {
        if (lexicalHandler instanceof SAXContentHandler) {
            this.contentHandler = (SAXContentHandler)lexicalHandler;
            super.setLexicalHandler((LexicalHandler)this.contentHandler);
        }
    }
}

