Class ImportHandler
- java.lang.Object
- 
- org.xml.sax.helpers.DefaultHandler
- 
- org.apache.jackrabbit.jcr2spi.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 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).
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleannsContextStartedthis 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 SummaryConstructors Constructor Description ImportHandler(Importer importer, NamespaceResolver nsResolver, NamespaceRegistry nsReg, NameFactory nameFactory, PathFactory pathFactory)
 - 
Method SummaryAll 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)voidendPrefixMapping(String prefix)voiderror(SAXParseException e)voidfatalError(SAXParseException e)StringgetUniquePrefix(String uriHint)Returns a prefix that is unique among the already registered prefixes.voidstartDocument()voidstartElement(String namespaceURI, String localName, String qName, Attributes atts)voidstartPrefixMapping(String prefix, String uri)voidwarning(SAXParseException e)- 
Methods inherited from class org.xml.sax.helpers.DefaultHandlerignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl
 
- 
 
- 
- 
- 
Field Detail- 
nsContextStartedprotected 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 Detail- 
ImportHandlerpublic ImportHandler(Importer importer, NamespaceResolver nsResolver, NamespaceRegistry nsReg, NameFactory nameFactory, PathFactory pathFactory) 
 
- 
 - 
Method Detail- 
warningpublic void warning(SAXParseException e) throws SAXException - Specified by:
- warningin interface- ErrorHandler
- Overrides:
- warningin class- DefaultHandler
- Throws:
- SAXException
 
 - 
errorpublic void error(SAXParseException e) throws SAXException - Specified by:
- errorin interface- ErrorHandler
- Overrides:
- errorin class- DefaultHandler
- Throws:
- SAXException
 
 - 
fatalErrorpublic void fatalError(SAXParseException e) throws SAXException - Specified by:
- fatalErrorin interface- ErrorHandler
- Overrides:
- fatalErrorin class- DefaultHandler
- Throws:
- SAXException
 
 - 
startDocumentpublic void startDocument() throws SAXException- Specified by:
- startDocumentin interface- ContentHandler
- Overrides:
- startDocumentin class- DefaultHandler
- Throws:
- SAXException
 
 - 
endDocumentpublic void endDocument() throws SAXException- Specified by:
- endDocumentin interface- ContentHandler
- Overrides:
- endDocumentin class- DefaultHandler
- Throws:
- SAXException
 
 - 
startPrefixMappingpublic void startPrefixMapping(String prefix, String uri) throws SAXException - Specified by:
- startPrefixMappingin interface- ContentHandler
- Overrides:
- startPrefixMappingin class- DefaultHandler
- Throws:
- SAXException
 
 - 
endPrefixMappingpublic void endPrefixMapping(String prefix) throws SAXException - Specified by:
- endPrefixMappingin interface- ContentHandler
- Overrides:
- endPrefixMappingin class- DefaultHandler
- Throws:
- SAXException
 
 - 
startElementpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException - Specified by:
- startElementin interface- ContentHandler
- Overrides:
- startElementin class- DefaultHandler
- Throws:
- SAXException
 
 - 
characterspublic void characters(char[] ch, int start, int length) throws SAXException- Specified by:
- charactersin interface- ContentHandler
- Overrides:
- charactersin class- DefaultHandler
- Throws:
- SAXException
 
 - 
endElementpublic void endElement(String namespaceURI, String localName, String qName) throws SAXException - Specified by:
- endElementin interface- ContentHandler
- Overrides:
- endElementin class- DefaultHandler
- Throws:
- SAXException
 
 - 
getUniquePrefixpublic String getUniquePrefix(String uriHint) throws RepositoryException Returns a prefix that is unique among the already registered prefixes.- Parameters:
- uriHint- namespace uri that serves as hint for the prefix generation
- Returns:
- a unique prefix
- Throws:
- RepositoryException
 
 
- 
 
-