Class InfoXMLHandler

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

    public class InfoXMLHandler
    extends org.xml.sax.helpers.DefaultHandler
    Parser for ShakeMap info.xml metadata.
    • Constructor Summary

      Constructors 
      Constructor Description
      InfoXMLHandler()
      Construct a new SAX Handler for an info.xml document.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.HashMap<java.lang.String,​java.lang.String> getInfo()  
      java.util.HashMap<java.lang.String,​java.lang.String> parse​(java.lang.Object in)  
      void startElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)  
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        characters, endDocument, endElement, 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
    • Constructor Detail

      • InfoXMLHandler

        public InfoXMLHandler()
        Construct a new SAX Handler for an info.xml document.
    • Method Detail

      • parse

        public java.util.HashMap<java.lang.String,​java.lang.String> parse​(java.lang.Object in)
                                                                         throws java.lang.Exception
        Parameters:
        in - - the file or stream to parse
        Returns:
        the ShakeMap associated with this XML handler
        Throws:
        java.lang.Exception - if error occurs
      • getInfo

        public java.util.HashMap<java.lang.String,​java.lang.String> getInfo()
        Returns:
        the parsed info.
      • startElement

        public final void startElement​(java.lang.String uri,
                                       java.lang.String localName,
                                       java.lang.String qName,
                                       org.xml.sax.Attributes attributes)
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        uri - - the uri for this element
        localName - - the local name for this element
        qName - - the fully-qualified name for this element
        attributes - - the attributes of the element