org.apache.jackrabbit.oak.jcr.xml
Class ImportHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.jackrabbit.oak.jcr.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 ContentHandler
s
(i.e. SysViewImportHandler
and DocViewImportHandler
).
The actual task of importing though is delegated to the implementation of
the {@link 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).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
locator
protected Locator locator
ImportHandler
public ImportHandler(String absPath,
SessionContext sessionContext,
int uuidBehavior,
boolean isWorkspaceImport)
throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
warning
public void warning(SAXParseException e)
throws SAXException
- Specified by:
warning
in interface ErrorHandler
- Overrides:
warning
in class DefaultHandler
- Throws:
SAXException
error
public void error(SAXParseException e)
throws SAXException
- Specified by:
error
in interface ErrorHandler
- Overrides:
error
in class DefaultHandler
- Throws:
SAXException
fatalError
public void fatalError(SAXParseException e)
throws SAXException
- Specified by:
fatalError
in interface ErrorHandler
- Overrides:
fatalError
in class DefaultHandler
- Throws:
SAXException
endDocument
public void endDocument()
throws SAXException
- Specified by:
endDocument
in interface ContentHandler
- Overrides:
endDocument
in class DefaultHandler
- Throws:
SAXException
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
- Records the given namespace mapping to be included in the local
namespace context. The local namespace context is instantiated
in
startElement(String, String, String, Attributes)
using
all the the namespace mappings recorded for the current XML element.
The namespace is also recorded in the persistent namespace registry
unless it is already known.
- Specified by:
startPrefixMapping
in interface ContentHandler
- Overrides:
startPrefixMapping
in class DefaultHandler
- Parameters:
prefix
- namespace prefixuri
- namespace URI
- Throws:
SAXException
endPrefixMapping
public void endPrefixMapping(String prefix)
throws SAXException
- Specified by:
endPrefixMapping
in interface ContentHandler
- Overrides:
endPrefixMapping
in class DefaultHandler
- Throws:
SAXException
startElement
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
- Specified by:
startElement
in interface ContentHandler
- Overrides:
startElement
in class DefaultHandler
- Throws:
SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
- Specified by:
characters
in interface ContentHandler
- Overrides:
characters
in class DefaultHandler
- Throws:
SAXException
endElement
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
- Delegates the call to the underlying target handler and asks the
handler to end the current namespace context.
- Specified by:
endElement
in interface ContentHandler
- Overrides:
endElement
in class DefaultHandler
- Throws:
SAXException
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interface ContentHandler
- Overrides:
setDocumentLocator
in class DefaultHandler
Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.