Package gov.usgs.earthquake.eids
Class EventAddonParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- gov.usgs.util.SAXAdapter
-
- gov.usgs.earthquake.eids.EventAddonParser
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class EventAddonParser extends SAXAdapter
Parser for event addon messages. Maps these messages into an EQMessage with a product link.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventAddonParser.EventAddon
Data structure for event addon message.
-
Field Summary
Fields Modifier and Type Field Description static java.text.SimpleDateFormat
ADDON_DATE_FORMAT
Date format used in event addon message.
-
Constructor Summary
Constructors Constructor Description EventAddonParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventAddonParser.EventAddon
getAddon()
Get parsed addon.void
onEndElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, java.lang.String content)
SAXAdapter end element handler.void
onStartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
SAXAdapter start element handler.gov.usgs.ansseqmsg.EQMessage
parseMessage(EIDSMessageEvent event)
Takes a EIDSMessage event and returns the EQMessage-
Methods inherited from class gov.usgs.util.SAXAdapter
characters, endElement, parse, parse, startElement
-
-
-
-
Method Detail
-
parseMessage
public gov.usgs.ansseqmsg.EQMessage parseMessage(EIDSMessageEvent event) throws java.lang.Exception
Takes a EIDSMessage event and returns the EQMessage- Parameters:
event
- EIDSMessageEvent to parse- Returns:
- an EQmessage
- Throws:
java.lang.Exception
- if error occurs
-
getAddon
public EventAddonParser.EventAddon getAddon()
Get parsed addon.- Returns:
- parsed addon, or null if nothing parsed.
-
onStartElement
public void onStartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
SAXAdapter start element handler.- Overrides:
onStartElement
in classSAXAdapter
- Parameters:
uri
- element uri.localName
- element localName.qName
- element qName.attributes
- element attributes.- Throws:
org.xml.sax.SAXException
- if there is an error.
-
onEndElement
public void onEndElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, java.lang.String content) throws org.xml.sax.SAXException
SAXAdapter end element handler. Content only includes characters that were read from this element, NOT any characters from child elements.- Overrides:
onEndElement
in classSAXAdapter
- Parameters:
uri
- element uri.localName
- element localName.qName
- element qName.content
- element content.- Throws:
org.xml.sax.SAXException
- if onEndElement throws a SAXException.
-
-