Class ImportHandler

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class ImportHandler
    extends org.xml.sax.helpers.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 ContentHandlers (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 
      Modifier and Type Field Description
      protected org.xml.sax.Locator locator  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImportHandler​(java.lang.String absPath, SessionContext sessionContext, int uuidBehavior, boolean isWorkspaceImport)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void characters​(char[] ch, int start, int length)  
      void endDocument()  
      void endElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
      Delegates the call to the underlying target handler and asks the handler to end the current namespace context.
      void endPrefixMapping​(java.lang.String prefix)  
      void error​(org.xml.sax.SAXParseException e)  
      void fatalError​(org.xml.sax.SAXParseException e)  
      void setDocumentLocator​(org.xml.sax.Locator locator)  
      void startElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)  
      void startPrefixMapping​(java.lang.String prefix, java.lang.String uri)
      Records the given namespace mapping to be included in the local namespace context.
      void warning​(org.xml.sax.SAXParseException e)  
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, unparsedEntityDecl
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • locator

        protected org.xml.sax.Locator locator
    • Method Detail

      • warning

        public void warning​(org.xml.sax.SAXParseException e)
                     throws org.xml.sax.SAXException
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Overrides:
        warning in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • error

        public void error​(org.xml.sax.SAXParseException e)
                   throws org.xml.sax.SAXException
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Overrides:
        error in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException e)
                        throws org.xml.sax.SAXException
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Overrides:
        fatalError in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.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 org.xml.sax.ContentHandler
        Overrides:
        startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        prefix - namespace prefix
        uri - namespace URI
        Throws:
        org.xml.sax.SAXException
      • endPrefixMapping

        public void endPrefixMapping​(java.lang.String prefix)
                              throws org.xml.sax.SAXException
        Specified by:
        endPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        endPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • startElement

        public void startElement​(java.lang.String namespaceURI,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes atts)
                          throws org.xml.sax.SAXException
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String namespaceURI,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Delegates the call to the underlying target handler and asks the handler to end the current namespace context.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
        Overrides:
        setDocumentLocator in class org.xml.sax.helpers.DefaultHandler