Class SavingHandler

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String END_OF_DOCUMENT  
      private java.util.List<java.lang.String> events
      The sequence of events taken place so far.
      static java.lang.String START_OF_DOCUMENT  
      private boolean strict
      Whether to save things like processing instructions as well.
    • Constructor Summary

      Constructors 
      Constructor Description
      SavingHandler()
      Creates a new SavingHandler.
      SavingHandler​(boolean strict)
      Creates a new SavingHandler instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void characters​(char[] chr, int start, int length)  
      void endDocument()  
      void endElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)  
      void endPrefixMapping​(java.lang.String prefix)  
      void foundCharAfterEndOfEndTag​(char chr)
      Notifies that a character was found after the "/" of an end tag.
      void foundIllegalCharInTag​(char chr)
      Notifies that an illegal character was found in a tag *****.
      void foundMultipleAttribute​(java.lang.String attrName, java.lang.Object oldAttrValue)
      Notifies the occurence of a duplicate attribute declaration within a start tag.
      void foundUnexpectedEndOfDocument()  
      java.util.List<java.lang.String> getEvents()
      Returns the sequence of events taken place so far.
      void ignorableWhitespace​(char[] chr, int start, int length)  
      void processingInstruction​(java.lang.String target, java.lang.String data)  
      void setDocumentLocator​(org.xml.sax.Locator locator)  
      void skippedEntity​(java.lang.String name)  
      void startDocument()  
      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)  
      • Methods inherited from class java.lang.Object

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

      • START_OF_DOCUMENT

        public static final java.lang.String START_OF_DOCUMENT
        See Also:
        Constant Field Values
      • events

        private java.util.List<java.lang.String> events
        The sequence of events taken place so far.
      • strict

        private boolean strict
        Whether to save things like processing instructions as well.
    • Constructor Detail

      • SavingHandler

        public SavingHandler​(boolean strict)
        Creates a new SavingHandler instance.
        Parameters:
        strict - a boolean value signifying whether to save things like processing instructions as well.
      • SavingHandler

        public SavingHandler()
        Creates a new SavingHandler.
    • Method Detail

      • getEvents

        public java.util.List<java.lang.String> getEvents()
        Returns the sequence of events taken place so far.
        Returns:
        events.
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • endDocument

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

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.SAXException
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        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
        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
        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
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • characters

        public void characters​(char[] chr,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] chr,
                                        int start,
                                        int length)
                                 throws org.xml.sax.SAXException
        Specified by:
        ignorableWhitespace in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.String data)
                                   throws org.xml.sax.SAXException
        Specified by:
        processingInstruction in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • skippedEntity

        public void skippedEntity​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Specified by:
        skippedEntity in interface org.xml.sax.ContentHandler
        Throws:
        org.xml.sax.SAXException
      • foundMultipleAttribute

        public void foundMultipleAttribute​(java.lang.String attrName,
                                           java.lang.Object oldAttrValue)
        Description copied from interface: ParseExceptionHandler
        Notifies the occurence of a duplicate attribute declaration within a start tag.
        Specified by:
        foundMultipleAttribute in interface ParseExceptionHandler
        Parameters:
        attrName - a non-empty String representing the name of the attribute.
        oldAttrValue - an Object which is either a String representing the value of the attribute or the object AttributesImpl.NO_VALUE which signifies the absence of a value. Here the old value (which is overwritten in the attribute list) should be passed to the application. ****** it is not clear to me whether the ordering of the attribute list is significant. The former occurence of the attribute is lost. **** is this true?
      • foundIllegalCharInTag

        public void foundIllegalCharInTag​(char chr)
        Description copied from interface: ParseExceptionHandler
        Notifies that an illegal character was found in a tag *****. To be more precise: at the beginning of the tag. Note that this is ignored and the next one is read.
        Specified by:
        foundIllegalCharInTag in interface ParseExceptionHandler
        Parameters:
        chr - the illegal char value.
      • foundCharAfterEndOfEndTag

        public void foundCharAfterEndOfEndTag​(char chr)
        Description copied from interface: ParseExceptionHandler
        Notifies that a character was found after the "/" of an end tag. Note that this is ignored and the next one is read.
        Specified by:
        foundCharAfterEndOfEndTag in interface ParseExceptionHandler
        Parameters:
        chr - the illegal char value.