Package gov.usgs.earthquake.shakemap
Class InfoXMLHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- gov.usgs.earthquake.shakemap.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
-
-
-
-
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 interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
- Parameters:
uri
- - the uri for this elementlocalName
- - the local name for this elementqName
- - the fully-qualified name for this elementattributes
- - the attributes of the element
-
-