Package org.apache.jackrabbit.core.xml
Class ImportHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.jackrabbit.core.xml.ImportHandler
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class ImportHandler extends DefaultHandler
AnImportHandlerinstance can be used to import serialized data in System View XML or Document View XML. Processing of the XML is handled by specializedContentHandlers (i.e.SysViewImportHandlerandDocViewImportHandler).The actual task of importing though is delegated to the implementation of the
interface.ImporterImportant Note:
These SAX Event Handlers expect that Namespace URI's and local names are reported in the
start/endElementevents and thatstart/endPrefixMappingevents are reported (i.e. default SAX2 Namespace processing).
-
-
Constructor Summary
Constructors Constructor Description ImportHandler(Importer importer, Session session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendDocument()voidendElement(String namespaceURI, String localName, String qName)Delegates the call to the underlying target handler and asks the handler to end the current namespace context.voiderror(SAXParseException e)voidfatalError(SAXParseException e)voidsetDocumentLocator(Locator locator)voidstartElement(String namespaceURI, String localName, String qName, Attributes atts)voidstartPrefixMapping(String prefix, String uri)Records the given namespace mapping to be included in the local namespace context.voidwarning(SAXParseException e)-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
ImportHandler
public ImportHandler(Importer importer, Session session) throws RepositoryException
- Throws:
RepositoryException
-
-
Method Detail
-
warning
public void warning(SAXParseException e) throws SAXException
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Throws:
SAXException
-
error
public void error(SAXParseException e) throws SAXException
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
fatalError
public void fatalError(SAXParseException e) throws SAXException
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- 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 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:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classDefaultHandler- Parameters:
prefix- namespace prefixuri- namespace URI- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- 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:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classDefaultHandler
-
-