Class ProductTrackerParser

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

    public class ProductTrackerParser
    extends SAXAdapter
    Parser for ProductTracker responses.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProductTrackerParser​(java.net.URL trackerURL)
      Create a new TrackerUpdateParser.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<ProductTrackerUpdate> getUpdates()
      Get the parsed updates.
      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.
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        endDocument, 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
    • Constructor Detail

      • ProductTrackerParser

        public ProductTrackerParser​(java.net.URL trackerURL)
        Create a new TrackerUpdateParser.
        Parameters:
        trackerURL - URL that generated the list being parsed
    • Method Detail

      • getUpdates

        public java.util.List<ProductTrackerUpdate> getUpdates()
        Get the parsed updates.
        Returns:
        list of parsed updates
      • 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 class SAXAdapter
        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 class SAXAdapter
        Parameters:
        uri - element uri.
        localName - element localName.
        qName - element qName.
        content - element content.
        Throws:
        org.xml.sax.SAXException - if onEndElement throws a SAXException.