Class GridXMLHandler

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

    public class GridXMLHandler
    extends org.xml.sax.helpers.DefaultHandler
    Parser for ShakeMap grid.xml metadata. Accepts a ShakeMap object and updates the properties of that product based on the product's grid.xml file.
    • Field Detail

      • SHAKEMAPGRID_ELEMENT

        public static final java.lang.String SHAKEMAPGRID_ELEMENT
        Element for shakemap grid
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_ID

        public static final java.lang.String SHAKEMAPGRID_ID
        Shakemap grid id
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_ORIGINATOR

        public static final java.lang.String SHAKEMAPGRID_ORIGINATOR
        Shakemap grid originator
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_TIMESTAMP

        public static final java.lang.String SHAKEMAPGRID_TIMESTAMP
        Shakemap grid process timestamp
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_VERSION

        public static final java.lang.String SHAKEMAPGRID_VERSION
        Shakemap grid version
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_EVENT_TYPE

        public static final java.lang.String SHAKEMAPGRID_EVENT_TYPE
        Shakemap grid event type
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_EVENT_STATUS

        public static final java.lang.String SHAKEMAPGRID_EVENT_STATUS
        Shakemap grid event/map status
        See Also:
        Constant Field Values
      • EVENT_ELEMENT

        public static final java.lang.String EVENT_ELEMENT
        Element for event
        See Also:
        Constant Field Values
      • EVENT_LATITUDE

        public static final java.lang.String EVENT_LATITUDE
        Event latitude
        See Also:
        Constant Field Values
      • EVENT_LONGITUDE

        public static final java.lang.String EVENT_LONGITUDE
        Event longitude
        See Also:
        Constant Field Values
      • EVENT_MAGNITUDE

        public static final java.lang.String EVENT_MAGNITUDE
        Event magnitude
        See Also:
        Constant Field Values
      • EVENT_TIMESTAMP

        public static final java.lang.String EVENT_TIMESTAMP
        Event timestamp
        See Also:
        Constant Field Values
      • EVENT_DESCRIPTION

        public static final java.lang.String EVENT_DESCRIPTION
        Event description
        See Also:
        Constant Field Values
      • EVENT_DEPTH

        public static final java.lang.String EVENT_DEPTH
        Event depth
        See Also:
        Constant Field Values
      • EVENT_NETWORK

        public static final java.lang.String EVENT_NETWORK
        GSM Parameter when using a different network as a backup
        See Also:
        Constant Field Values
      • EVENT_ID

        public static final java.lang.String EVENT_ID
        GSM Parameter when using a different network as a backup
        See Also:
        Constant Field Values
      • GRIDSPEC_ELEMENT

        public static final java.lang.String GRIDSPEC_ELEMENT
        Element for grid specification
        See Also:
        Constant Field Values
      • GRIDSPEC_LONMIN

        public static final java.lang.String GRIDSPEC_LONMIN
        gridspec longitude min
        See Also:
        Constant Field Values
      • GRIDSPEC_LONMAX

        public static final java.lang.String GRIDSPEC_LONMAX
        gridspec longitude max
        See Also:
        Constant Field Values
      • GRIDSPEC_LATMIN

        public static final java.lang.String GRIDSPEC_LATMIN
        gridspec latitude min
        See Also:
        Constant Field Values
      • GRIDSPEC_LATMAX

        public static final java.lang.String GRIDSPEC_LATMAX
        gridspec latitude max
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_ELEMENT_XML

        public static final java.lang.String SHAKEMAPGRID_ELEMENT_XML
        XML for SHAKEMAPGRID_ELEMENT
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_ID_XML

        public static final java.lang.String SHAKEMAPGRID_ID_XML
        XML for SHAKEMAPGRID_ID
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_ORIGINATOR_XML

        public static final java.lang.String SHAKEMAPGRID_ORIGINATOR_XML
        XML for SHAKEMAPGRID_ORIGINATOR
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_TIMESTAMP_XML

        public static final java.lang.String SHAKEMAPGRID_TIMESTAMP_XML
        XML for SHAKEMAPGRID_TIMESTAMP
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_VERSION_XML

        public static final java.lang.String SHAKEMAPGRID_VERSION_XML
        XML for SHAKEMAPGRID_VERSION
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_EVENT_TYPE_XML

        public static final java.lang.String SHAKEMAPGRID_EVENT_TYPE_XML
        XML for SHAKEMAPGRID_EVENT_TYPE
        See Also:
        Constant Field Values
      • SHAKEMAPGRID_EVENT_STATUS_XML

        public static final java.lang.String SHAKEMAPGRID_EVENT_STATUS_XML
        XML for SHAKEMAPGRID_EVENT_STATUS
        See Also:
        Constant Field Values
      • EVENT_ELEMENT_XML

        public static final java.lang.String EVENT_ELEMENT_XML
        XML for EVENT_ELEMENT
        See Also:
        Constant Field Values
      • EVENT_LATITUDE_XML

        public static final java.lang.String EVENT_LATITUDE_XML
        XML for EVENT_LATITUDE
        See Also:
        Constant Field Values
      • EVENT_LONGITUDE_XML

        public static final java.lang.String EVENT_LONGITUDE_XML
        XML for EVENT_LONGITUDE
        See Also:
        Constant Field Values
      • EVENT_MAGNITUDE_XML

        public static final java.lang.String EVENT_MAGNITUDE_XML
        XML for EVENT_MAGNITUDE
        See Also:
        Constant Field Values
      • EVENT_TIMESTAMP_XML

        public static final java.lang.String EVENT_TIMESTAMP_XML
        XML for EVENT_TIMESTAMP
        See Also:
        Constant Field Values
      • EVENT_DESCRIPTION_XML

        public static final java.lang.String EVENT_DESCRIPTION_XML
        XML for EVENT_DESCRIPTION
        See Also:
        Constant Field Values
      • EVENT_DEPTH_XML

        public static final java.lang.String EVENT_DEPTH_XML
        XML for EVENT_DEPTH
        See Also:
        Constant Field Values
      • EVENT_NETWORK_XML

        public static final java.lang.String EVENT_NETWORK_XML
        XML for EVENT_NETWORK
        See Also:
        Constant Field Values
      • EVENT_ID_XML

        public static final java.lang.String EVENT_ID_XML
        XML for EVENT_ID
        See Also:
        Constant Field Values
      • GRIDSPEC_ELEMENT_XML

        public static final java.lang.String GRIDSPEC_ELEMENT_XML
        XML for GRIDSPEC_ELEMENT
        See Also:
        Constant Field Values
      • GRIDSPEC_LONMIN_XML

        public static final java.lang.String GRIDSPEC_LONMIN_XML
        XML for GRIDSPEC_LONMIN
        See Also:
        Constant Field Values
      • GRIDSPEC_LONMAX_XML

        public static final java.lang.String GRIDSPEC_LONMAX_XML
        XML for GRIDSPEC_LONMAX
        See Also:
        Constant Field Values
      • GRIDSPEC_LATMIN_XML

        public static final java.lang.String GRIDSPEC_LATMIN_XML
        XML for GRIDSPEC_LATMIN
        See Also:
        Constant Field Values
      • GRIDSPEC_LATMAX_XML

        public static final java.lang.String GRIDSPEC_LATMAX_XML
        XML for GRIDSPEC_LATMAX
        See Also:
        Constant Field Values
      • GRIDDATA_ELEMENT

        public static final java.lang.String GRIDDATA_ELEMENT
        Element for Shakemap griddata
        See Also:
        Constant Field Values
      • STOP_PARSING_BEFORE_GRIDDATA

        public static final java.lang.String STOP_PARSING_BEFORE_GRIDDATA
        Shakemap griddata parameter to stop parsing before
        See Also:
        Constant Field Values
    • Constructor Detail

      • GridXMLHandler

        public GridXMLHandler()
        Construct a new SAX Handler for an grid.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)
                                throws org.xml.sax.SAXException
        Read grid, event, and gridspec element attributes.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        uri - namespace of element.
        localName - name of element.
        qName - qualified name of element.
        attributes - element attributes.
        Throws:
        org.xml.sax.SAXException - when griddata element is reached, to stop parsing.