Package gov.usgs.earthquake.dyfi
Class EventDataXMLHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
gov.usgs.earthquake.dyfi.EventDataXMLHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
Parser for DYFI "eventdata.xml" metadata.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
XML Element Name for cdi_summaryMap of XML attributesstatic final String
XML Element Name for eventstatic final String
XML Element Name for event_datastatic final String
XML Element Name for productsstatic final String
Static string to stop parsing before list of products -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDYFI()
void
setDYFI
(DYFIProduct dyfi) final void
startElement
(String uri, String localName, String qName, 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
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
DYFI_EVENTDATA_ELEMENT
XML Element Name for event_data- See Also:
-
DYFI_EVENT_ELEMENT
XML Element Name for event- See Also:
-
DYFI_CDI_SUMMARY_ELEMENT
XML Element Name for cdi_summary- See Also:
-
DYFI_PRODUCTS_ELEMENT
XML Element Name for products- See Also:
-
DYFI_STOP_PARSING_BEFORE_PRODUCTS
Static string to stop parsing before list of products- See Also:
-
DYFI_ELEMENT_ATTRIBUTES
Map of XML attributes
-
-
Constructor Details
-
EventDataXMLHandler
Constructor- Parameters:
dyfi
- takes in DYFIProduct
-
-
Method Details
-
getDYFI
- Returns:
- DYFIProduct
-
setDYFI
- Parameters:
dyfi
- Product to set
-
parse
- Parameters:
in
- XML object to parse- Returns:
- DYFIProduct
- Throws:
Exception
- if exception message equals stop_parsing string
-
startElement
public final void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-