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 StringXML Element Name for cdi_summaryMap of XML attributesstatic final StringXML Element Name for eventstatic final StringXML Element Name for event_datastatic final StringXML Element Name for productsstatic final StringStatic string to stop parsing before list of products -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDYFI()voidsetDYFI(DYFIProduct dyfi) final voidstartElement(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, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-