public class ImportHandler extends DefaultHandler
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 interface.
Importer
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).
| Modifier and Type | Field and Description |
|---|---|
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 preceding startPrefixMapping event;
the flag is set per element in the first startPrefixMapping event and is
cleared again in the following startElement event;
|
| Constructor and Description |
|---|
ImportHandler(Importer importer,
NamespaceResolver nsResolver,
NamespaceRegistry nsReg,
NameFactory nameFactory,
PathFactory pathFactory) |
| Modifier and Type | Method and Description |
|---|---|
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) |
String |
getUniquePrefix(String uriHint)
Returns a prefix that is unique among the already registered prefixes.
|
void |
startDocument() |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
warning(SAXParseException e) |
ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDeclprotected boolean nsContextStarted
public ImportHandler(Importer importer, NamespaceResolver nsResolver, NamespaceRegistry nsReg, NameFactory nameFactory, PathFactory pathFactory)
public void warning(SAXParseException e) throws SAXException
warning in interface ErrorHandlerwarning in class DefaultHandlerSAXExceptionpublic void error(SAXParseException e) throws SAXException
error in interface ErrorHandlererror in class DefaultHandlerSAXExceptionpublic void fatalError(SAXParseException e) throws SAXException
fatalError in interface ErrorHandlerfatalError in class DefaultHandlerSAXExceptionpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerSAXExceptionpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionpublic String getUniquePrefix(String uriHint) throws RepositoryException
uriHint - namespace uri that serves as hint for the prefix generationRepositoryExceptionCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.