org.exist.memtree
Class DocumentBuilderReceiver

java.lang.Object
  extended by org.exist.memtree.DocumentBuilderReceiver
All Implemented Interfaces:
Receiver, ContentHandler, LexicalHandler

public class DocumentBuilderReceiver
extends Object
implements ContentHandler, LexicalHandler, Receiver

Builds an in-memory DOM tree from SAX Receiver events.

Author:
Wolfgang

Field Summary
 
Fields inherited from interface org.exist.util.serializer.Receiver
MATCH_ELEMENT
 
Constructor Summary
DocumentBuilderReceiver()
           
DocumentBuilderReceiver(MemTreeBuilder builder)
           
 
Method Summary
 void addNamespaceNode(QName qname)
           
 void addReferenceNode(NodeProxy proxy)
           
 void attribute(QName qname, String value)
           
 void cdataSection(char[] ch, int start, int len)
           
 void characters(char[] ch, int start, int len)
           
 void characters(CharSequence seq)
           
 void comment(char[] ch, int start, int length)
           
 void documentType(String name, String publicId, String systemId)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(QName qname)
           
 void endElement(String arg0, String arg1, String arg2)
           
 void endEntity(String name)
           
 void endPrefixMapping(String arg0)
           
 XQueryContext getContext()
           
 Document getDocument()
           
 void highlightText(CharSequence seq)
           
 void ignorableWhitespace(char[] arg0, int arg1, int arg2)
           
 void processingInstruction(String target, String data)
           
 void setCurrentNode(StoredNode node)
           
 void setDocumentLocator(Locator arg0)
           
 void skippedEntity(String arg0)
           
 void startCDATA()
           
 void startDocument()
           
 void startDTD(String name, String publicId, String systemId)
           
 void startElement(QName qname, AttrList attribs)
           
 void startElement(String namespaceURI, String localName, String qName, Attributes attrs)
           
 void startEntity(String name)
           
 void startPrefixMapping(String arg0, String arg1)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentBuilderReceiver

public DocumentBuilderReceiver()

DocumentBuilderReceiver

public DocumentBuilderReceiver(MemTreeBuilder builder)
Method Detail

getDocument

public Document getDocument()
Specified by:
getDocument in interface Receiver

getContext

public XQueryContext getContext()

setDocumentLocator

public void setDocumentLocator(Locator arg0)
Specified by:
setDocumentLocator in interface ContentHandler

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface Receiver
Specified by:
startDocument in interface ContentHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface Receiver
Specified by:
endDocument in interface ContentHandler
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String arg0,
                               String arg1)
                        throws SAXException
Specified by:
startPrefixMapping in interface Receiver
Specified by:
startPrefixMapping in interface ContentHandler
Throws:
SAXException

endPrefixMapping

public void endPrefixMapping(String arg0)
                      throws SAXException
Specified by:
endPrefixMapping in interface Receiver
Specified by:
endPrefixMapping in interface ContentHandler
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attrs)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Throws:
SAXException

startElement

public void startElement(QName qname,
                         AttrList attribs)
Specified by:
startElement in interface Receiver

endElement

public void endElement(String arg0,
                       String arg1,
                       String arg2)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Throws:
SAXException

endElement

public void endElement(QName qname)
                throws SAXException
Specified by:
endElement in interface Receiver
Throws:
SAXException

addReferenceNode

public void addReferenceNode(NodeProxy proxy)
                      throws SAXException
Throws:
SAXException

addNamespaceNode

public void addNamespaceNode(QName qname)
                      throws SAXException
Throws:
SAXException

characters

public void characters(CharSequence seq)
                throws SAXException
Specified by:
characters in interface Receiver
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int len)
                throws SAXException
Specified by:
characters in interface ContentHandler
Throws:
SAXException

attribute

public void attribute(QName qname,
                      String value)
               throws SAXException
Specified by:
attribute in interface Receiver
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] arg0,
                                int arg1,
                                int arg2)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface Receiver
Specified by:
processingInstruction in interface ContentHandler
Throws:
SAXException

cdataSection

public void cdataSection(char[] ch,
                         int start,
                         int len)
                  throws SAXException
Specified by:
cdataSection in interface Receiver
Throws:
SAXException

skippedEntity

public void skippedEntity(String arg0)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Throws:
SAXException

endCDATA

public void endCDATA()
              throws SAXException
Specified by:
endCDATA in interface LexicalHandler
Throws:
SAXException

endDTD

public void endDTD()
            throws SAXException
Specified by:
endDTD in interface LexicalHandler
Throws:
SAXException

startCDATA

public void startCDATA()
                throws SAXException
Specified by:
startCDATA in interface LexicalHandler
Throws:
SAXException

documentType

public void documentType(String name,
                         String publicId,
                         String systemId)
                  throws SAXException
Specified by:
documentType in interface Receiver
Throws:
SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Specified by:
comment in interface Receiver
Specified by:
comment in interface LexicalHandler
Throws:
SAXException

endEntity

public void endEntity(String name)
               throws SAXException
Specified by:
endEntity in interface LexicalHandler
Throws:
SAXException

startEntity

public void startEntity(String name)
                 throws SAXException
Specified by:
startEntity in interface LexicalHandler
Throws:
SAXException

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
              throws SAXException
Specified by:
startDTD in interface LexicalHandler
Throws:
SAXException

highlightText

public void highlightText(CharSequence seq)
Specified by:
highlightText in interface Receiver

setCurrentNode

public void setCurrentNode(StoredNode node)
Specified by:
setCurrentNode in interface Receiver


Copyright (C) Wolfgang Meier. All rights reserved.