Class EventDataXMLHandler

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

    public class EventDataXMLHandler
    extends org.xml.sax.helpers.DefaultHandler
    Parser for DYFI "eventdata.xml" metadata.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DYFIProduct getDYFI()  
      DYFIProduct parse​(java.lang.Object in)  
      void setDYFI​(DYFIProduct dyfi)  
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DYFI_EVENTDATA_ELEMENT

        public static final java.lang.String DYFI_EVENTDATA_ELEMENT
        XML Element Name for event_data
        See Also:
        Constant Field Values
      • DYFI_EVENT_ELEMENT

        public static final java.lang.String DYFI_EVENT_ELEMENT
        XML Element Name for event
        See Also:
        Constant Field Values
      • DYFI_CDI_SUMMARY_ELEMENT

        public static final java.lang.String DYFI_CDI_SUMMARY_ELEMENT
        XML Element Name for cdi_summary
        See Also:
        Constant Field Values
      • DYFI_PRODUCTS_ELEMENT

        public static final java.lang.String DYFI_PRODUCTS_ELEMENT
        XML Element Name for products
        See Also:
        Constant Field Values
      • DYFI_STOP_PARSING_BEFORE_PRODUCTS

        public static final java.lang.String DYFI_STOP_PARSING_BEFORE_PRODUCTS
        Static string to stop parsing before list of products
        See Also:
        Constant Field Values
      • DYFI_ELEMENT_ATTRIBUTES

        public static final java.util.Map<java.lang.String,​java.lang.String[]> DYFI_ELEMENT_ATTRIBUTES
        Map of XML attributes
    • Constructor Detail

      • EventDataXMLHandler

        public EventDataXMLHandler​(DYFIProduct dyfi)
        Constructor
        Parameters:
        dyfi - takes in DYFIProduct
    • Method Detail

      • getDYFI

        public DYFIProduct getDYFI()
        Returns:
        DYFIProduct
      • setDYFI

        public void setDYFI​(DYFIProduct dyfi)
        Parameters:
        dyfi - Product to set
      • parse

        public DYFIProduct parse​(java.lang.Object in)
                          throws java.lang.Exception
        Parameters:
        in - XML object to parse
        Returns:
        DYFIProduct
        Throws:
        java.lang.Exception - if exception message equals stop_parsing string
      • 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
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException