Module platform

Class KeyHandler

All Implemented Interfaces:
DatasetTags, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class KeyHandler extends DefaultHandler implements DatasetTags
A SAX handler for reading a key.
  • Constructor Details

    • KeyHandler

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

    • startElement

      public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
      The start of an element.
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class DefaultHandler
      Parameters:
      namespaceURI - the namespace.
      localName - the element name.
      qName - the element name.
      atts - the attributes.
      Throws:
      SAXException - for errors.
    • endElement

      public void endElement(String namespaceURI, String localName, String qName) throws SAXException
      The end of an element.
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class DefaultHandler
      Parameters:
      namespaceURI - the namespace.
      localName - the element name.
      qName - the element name.
      Throws:
      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 ContentHandler
      Overrides:
      characters in class DefaultHandler
      Parameters:
      ch - character buffer.
      start - the start index.
      length - the length of the valid character data.
    • getCurrentText

      protected 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.