Class ImportHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.jackrabbit.oak.jcr.xml.ImportHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
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).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImportHandler
(String absPath, SessionContext sessionContext, int uuidBehavior, boolean isWorkspaceImport) -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
void
endElement
(String namespaceURI, String localName, String qName) Delegates the call to the underlying target handler and asks the handler to end the current namespace context.void
endPrefixMapping
(String prefix) void
void
void
setDocumentLocator
(Locator locator) void
startElement
(String namespaceURI, String localName, String qName, Attributes atts) void
startPrefixMapping
(String prefix, String uri) Records the given namespace mapping to be included in the local namespace context.void
Methods inherited from class org.xml.sax.helpers.DefaultHandler
ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, unparsedEntityDecl
-
Field Details
-
locator
-
-
Constructor Details
-
ImportHandler
public ImportHandler(String absPath, SessionContext sessionContext, int uuidBehavior, boolean isWorkspaceImport) throws RepositoryException - Throws:
RepositoryException
-
-
Method Details
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Overrides:
warning
in classDefaultHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classDefaultHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classDefaultHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
startPrefixMapping
Records the given namespace mapping to be included in the local namespace context. The local namespace context is instantiated instartElement(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 interfaceContentHandler
- Overrides:
startPrefixMapping
in classDefaultHandler
- Parameters:
prefix
- namespace prefixuri
- namespace URI- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
endElement
Delegates the call to the underlying target handler and asks the handler to end the current namespace context.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
-