org.apache.jackrabbit.core.xml
Class ImportHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.apache.jackrabbit.core.xml.ImportHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class ImportHandler
extends DefaultHandler

An ImportHandler instance can be used to import serialized data in System View XML or Document View XML. Processing of the XML is handled by specialized ContentHandlers (i.e. SysViewImportHandler and DocViewImportHandler).

The actual task of importing though is delegated to the implementation of the Importer interface.

Important Note:

These SAX Event Handlers expect that Namespace URI's and local names are reported in the start/endElement events and that start/endPrefixMapping events are reported (i.e. default SAX2 Namespace processing).


Field Summary
protected  Importer importer
           
protected  boolean initialized
           
protected  Locator locator
           
protected  org.apache.jackrabbit.core.xml.ImportHandler.NamespaceContext nsContext
           
protected  boolean nsContextStarted
          this flag is used to determine whether a namespace context needs to be started in the startElement event or if the namespace context has already been started in a preceeding startPrefixMapping event; the flag is set per element in the first startPrefixMapping event and is cleared again in the following startElement event;
protected  NamespaceRegistryImpl nsReg
           
protected  NamespaceResolver nsResolver
           
protected  boolean systemViewXML
           
protected  ContentHandler targetHandler
           
 
Constructor Summary
ImportHandler(Importer importer, NamespaceResolver nsResolver, NamespaceRegistryImpl nsReg)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          
 void endDocument()
          
 void endElement(String namespaceURI, String localName, String qName)
          
 void endPrefixMapping(String prefix)
          
 void error(SAXParseException e)
          
 void fatalError(SAXParseException e)
          
 void setDocumentLocator(Locator locator)
          
 void startDocument()
          
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
          
 void startPrefixMapping(String prefix, String uri)
          
 void warning(SAXParseException e)
          
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

importer

protected final Importer importer

nsReg

protected final NamespaceRegistryImpl nsReg

nsResolver

protected final NamespaceResolver nsResolver

locator

protected Locator locator

targetHandler

protected ContentHandler targetHandler

systemViewXML

protected boolean systemViewXML

initialized

protected boolean initialized

nsContext

protected final org.apache.jackrabbit.core.xml.ImportHandler.NamespaceContext nsContext

nsContextStarted

protected boolean nsContextStarted
this flag is used to determine whether a namespace context needs to be started in the startElement event or if the namespace context has already been started in a preceeding startPrefixMapping event; the flag is set per element in the first startPrefixMapping event and is cleared again in the following startElement event;

Constructor Detail

ImportHandler

public ImportHandler(Importer importer,
                     NamespaceResolver nsResolver,
                     NamespaceRegistryImpl nsReg)
Method Detail

warning

public void warning(SAXParseException e)
             throws SAXException

Throws:
SAXException

error

public void error(SAXParseException e)
           throws SAXException

Throws:
SAXException

fatalError

public void fatalError(SAXParseException e)
                throws SAXException

Throws:
SAXException

startDocument

public void startDocument()
                   throws SAXException

Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException

Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException

Throws:
SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException

Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException

Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException

Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException

Throws:
SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)



Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.