Class RegionsHandler

All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class RegionsHandler extends SAXAdapter
XML SAX Handler for ANSS "regions.xml". See the resource file etc/config/regions.xml Example:

 InputStream in = ...
 RegionsHanlder handler = new RegionsHandler();
 try {
     handler.parse(in)
 } finally {
     in.close();
 }
 return handler.regions;
 
  • Field Details

    • LOGGER

      public static final Logger LOGGER
      Logger object
    • regions

      public Regions regions
      the regions that have been parsed
    • updated

      public Date updated
      update timestamp
    • formatVersion

      public String formatVersion
      reported format version (no version-specific logic implemented)
  • Constructor Details

    • RegionsHandler

      public RegionsHandler()
  • Method Details

    • onStartElement

      public void onStartElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
      Start Element handler. Builds region objects, and parses other information.
      Overrides:
      onStartElement in class SAXAdapter
      Parameters:
      uri - namespace of element.
      localName - name of element.
      qName - qualified name of element.
      attributes - element attributes.
      Throws:
      SAXException - if there is an error.
    • onEndElement

      public void onEndElement(String uri, String localName, String qName, String content) throws SAXException
      End element handler. Adds built region objects to regions object.
      Overrides:
      onEndElement in class SAXAdapter
      Parameters:
      uri - namespace of element.
      localName - name of element.
      qName - qualified name of element.
      content - element content.
      Throws:
      SAXException - if onEndElement throws a SAXException.