Class KeyHandler

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

    public class KeyHandler
    extends org.xml.sax.helpers.DefaultHandler
    implements DatasetTags
    A SAX handler for reading a key.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void characters​(char[] ch, int start, int length)
      Receives some (or all) of the text in the current element.
      protected void clearCurrentText()
      Removes all text from the textbuffer at the end of a CDATA section.
      void endElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
      The end of an element.
      protected java.lang.String getCurrentText()
      Returns the current text of the textbuffer.
      void startElement​(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
      The start of an element.
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
      • Methods inherited from class java.lang.Object

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

      • rootHandler

        private RootHandler rootHandler
        The root handler.
      • itemHandler

        private ItemHandler itemHandler
        The item handler.
      • currentText

        private java.lang.StringBuffer currentText
        Storage for the current CDATA
    • Constructor Detail

      • KeyHandler

        public KeyHandler​(RootHandler rootHandler,
                          ItemHandler itemHandler)
        Creates a new handler.
        Parameters:
        rootHandler - the root handler.
        itemHandler - the item handler.
    • Method Detail

      • 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
        The start of an element.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        namespaceURI - the namespace.
        localName - the element name.
        qName - the element name.
        atts - the attributes.
        Throws:
        org.xml.sax.SAXException - for errors.
      • endElement

        public void endElement​(java.lang.String namespaceURI,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        The end of an element.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        namespaceURI - the namespace.
        localName - the element name.
        qName - the element name.
        Throws:
        org.xml.sax.SAXException - for errors.
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
        Receives some (or all) of the text in the current element.
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        ch - character buffer.
        start - the start index.
        length - the length of the valid character data.
      • getCurrentText

        protected java.lang.String getCurrentText()
        Returns the current text of the textbuffer.
        Returns:
        The current text.
      • clearCurrentText

        protected void clearCurrentText()
        Removes all text from the textbuffer at the end of a CDATA section.