org.restlet.ext.atom
Class FeedReader

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.restlet.ext.atom.FeedReader
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class FeedReader
extends DefaultHandler

Content reader for feeds that is able to transmit events to another FeedReader.

Author:
Thierry Boileau

Constructor Summary
FeedReader()
          Constructor.
FeedReader(FeedReader feedReader)
          Constructor.
 
Method Summary
 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(String uri, String localName, String qName)
           
 void endEntry(Entry entry)
          Called at the end of the XML block that defines the given entry.
 void endFeed(Feed feed)
          Called at the end of the XML block that defines the given feed.
 void endLink(Link link)
          Called at the end of the XML block that defines the given link.
 void endPrefixMapping(String prefix)
           
 void error(SAXParseException e)
           
 void fatalError(SAXParseException e)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void notationDecl(String name, String publicId, String systemId)
           
 void processingInstruction(String target, String data)
           
 InputSource resolveEntity(String publicId, String systemId)
           
 void setDocumentLocator(Locator locator)
           
 void skippedEntity(String name)
           
 void startContent(Content content)
          Called when a new content element has been detected in the Atom document.
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 void startEntry(Entry entry)
          Called when a new entry has been detected in the Atom document.
 void startFeed(Feed feed)
          Called when a new feed 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(String prefix, String uri)
           
 void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
           
 void warning(SAXParseException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedReader

public FeedReader()
Constructor.


FeedReader

public FeedReader(FeedReader feedReader)
Constructor.

Parameters:
feedReader - Additional feed reader that will receive all events.
Method Detail

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
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 SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
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.

endFeed

public void endFeed(Feed feed)
Called at the end of the XML block that defines the given feed.

Parameters:
feed - The current feed.

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(String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Overrides:
endPrefixMapping in class DefaultHandler
Throws:
SAXException

error

public void error(SAXParseException e)
           throws SAXException
Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException e)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Overrides:
ignorableWhitespace in class DefaultHandler
Throws:
SAXException

notationDecl

public void notationDecl(String name,
                         String publicId,
                         String systemId)
                  throws SAXException
Specified by:
notationDecl in interface DTDHandler
Overrides:
notationDecl in class DefaultHandler
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class DefaultHandler
Throws:
SAXException

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws IOException,
                                 SAXException
Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Throws:
IOException
SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class DefaultHandler

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Overrides:
skippedEntity in class DefaultHandler
Throws:
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 SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

startEntry

public void startEntry(Entry entry)
Called when a new entry has been detected in the Atom document.

Parameters:
entry - The current entry.

startFeed

public void startFeed(Feed feed)
Called when a new feed has been detected in the Atom document.

Parameters:
feed - The current feed.

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(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class DefaultHandler
Throws:
SAXException

unparsedEntityDecl

public void unparsedEntityDecl(String name,
                               String publicId,
                               String systemId,
                               String notationName)
                        throws SAXException
Specified by:
unparsedEntityDecl in interface DTDHandler
Overrides:
unparsedEntityDecl in class DefaultHandler
Throws:
SAXException

warning

public void warning(SAXParseException e)
             throws SAXException
Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler
Throws:
SAXException


Copyright © 2005-2013 Restlet.