Class EntryReader

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

    public class EntryReader
    extends org.xml.sax.helpers.DefaultHandler
    Content reader for entries that is able to transmit events to another EntryReader.
    Author:
    Thierry Boileau
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void characters​(char[] ch, int start, int length)  
      void endContent​(Content content)
      Called at the end of the XML block that defines the given content element.
      void endDocument()  
      void endElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName)  
      void endEntry​(Entry entry)
      Called at the end of the XML block that defines the given entry.
      void endLink​(Link link)
      Called at the end of the XML block that defines the given link.
      void endPrefixMapping​(java.lang.String prefix)  
      void error​(org.xml.sax.SAXParseException e)  
      void fatalError​(org.xml.sax.SAXParseException e)  
      void ignorableWhitespace​(char[] ch, int start, int length)  
      void notationDecl​(java.lang.String name, java.lang.String publicId, java.lang.String systemId)  
      void processingInstruction​(java.lang.String target, java.lang.String data)  
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)  
      void setDocumentLocator​(org.xml.sax.Locator locator)  
      void skippedEntity​(java.lang.String name)  
      void startContent​(Content content)
      Called when a new content element has been detected in the Atom document.
      void startDocument()  
      void startElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)  
      void startEntry​(Entry entry)
      Called when a new entry has been detected in the Atom document.
      void startLink​(Link link)
      Called when a new link has been detected in the Atom document.
      void startPrefixMapping​(java.lang.String prefix, java.lang.String uri)  
      void unparsedEntityDecl​(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)  
      void warning​(org.xml.sax.SAXParseException e)  
      • Methods inherited from class java.lang.Object

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

      • EntryReader

        public EntryReader()
        Constructor.
      • EntryReader

        public EntryReader​(EntryReader entryReader)
        Constructor.
        Parameters:
        entryReader - Additional feed reader that will receive all events.
    • Method Detail

      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endContent

        public void endContent​(Content content)
        Called at the end of the XML block that defines the given content element. By default, it relays the event to the extra handler.
        Parameters:
        content - The current content element.
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • endEntry

        public void endEntry​(Entry entry)
        Called at the end of the XML block that defines the given entry.
        Parameters:
        entry - The current entry.
      • endLink

        public void endLink​(Link link)
        Called at the end of the XML block that defines the given link.
        Parameters:
        link - The current link.
      • endPrefixMapping

        public void endPrefixMapping​(java.lang.String prefix)
                              throws org.xml.sax.SAXException
        Specified by:
        endPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        endPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • error

        public void error​(org.xml.sax.SAXParseException e)
                   throws org.xml.sax.SAXException
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Overrides:
        error in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException e)
                        throws org.xml.sax.SAXException
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Overrides:
        fatalError in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • ignorableWhitespace

        public void ignorableWhitespace​(char[] ch,
                                        int start,
                                        int length)
                                 throws org.xml.sax.SAXException
        Specified by:
        ignorableWhitespace in interface org.xml.sax.ContentHandler
        Overrides:
        ignorableWhitespace in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • notationDecl

        public void notationDecl​(java.lang.String name,
                                 java.lang.String publicId,
                                 java.lang.String systemId)
                          throws org.xml.sax.SAXException
        Specified by:
        notationDecl in interface org.xml.sax.DTDHandler
        Overrides:
        notationDecl in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          java.lang.String data)
                                   throws org.xml.sax.SAXException
        Specified by:
        processingInstruction in interface org.xml.sax.ContentHandler
        Overrides:
        processingInstruction in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.String systemId)
                                              throws java.io.IOException,
                                                     org.xml.sax.SAXException
        Specified by:
        resolveEntity in interface org.xml.sax.EntityResolver
        Overrides:
        resolveEntity in class org.xml.sax.helpers.DefaultHandler
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        Specified by:
        setDocumentLocator in interface org.xml.sax.ContentHandler
        Overrides:
        setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
      • skippedEntity

        public void skippedEntity​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Specified by:
        skippedEntity in interface org.xml.sax.ContentHandler
        Overrides:
        skippedEntity in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • startContent

        public void startContent​(Content content)
        Called when a new content element has been detected in the Atom document.
        Parameters:
        content - The current content element.
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Overrides:
        startDocument in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • startElement

        public 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
      • startEntry

        public void startEntry​(Entry entry)
        Called when a new entry has been detected in the Atom document.
        Parameters:
        entry - The current entry.
      • startLink

        public void startLink​(Link link)
        Called when a new link has been detected in the Atom document.
        Parameters:
        link - The current link.
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.SAXException
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • unparsedEntityDecl

        public void unparsedEntityDecl​(java.lang.String name,
                                       java.lang.String publicId,
                                       java.lang.String systemId,
                                       java.lang.String notationName)
                                throws org.xml.sax.SAXException
        Specified by:
        unparsedEntityDecl in interface org.xml.sax.DTDHandler
        Overrides:
        unparsedEntityDecl in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • warning

        public void warning​(org.xml.sax.SAXParseException e)
                     throws org.xml.sax.SAXException
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Overrides:
        warning in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException