Copyright (c) 2000-2002 ChurchillObjects.com

churchillobjects.rss4j.parser
Class RssParserImpl090

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--churchillobjects.rss4j.parser.RssParser
              |
              +--churchillobjects.rss4j.parser.RssParserImpl090
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, RssVersion
Direct Known Subclasses:
RssParserImpl091, RssParserImpl100

class RssParserImpl090
extends RssParser

Class to parse an RSS document according to the specifications of the RSS .90 standard. This object is created when the base parser already started parsing the document (and knows what the version number is), so it is given the document object and the known namespaces up to that point.


Field Summary
protected  boolean inChannel
          Indicates that the SAX handling process is currently in a channel.
protected  boolean inImage
          Indicates that the SAX handling process is currently in an image.
protected  boolean inItem
          Indicates that the SAX handling process is currently in an item.
protected  boolean inTextInput
          Indicates that the SAX handling process is currently in a text input.
private static java.lang.String VERSION
          Hard-coded version number for this handler's RSS version.
 
Fields inherited from class churchillobjects.rss4j.parser.RssParser
currentChannel, currentImage, currentItem, currentTextInput, document, namespaces
 
Fields inherited from interface churchillobjects.rss4j.model.RssVersion
VERSION_10, VERSION_90, VERSION_91
 
Constructor Summary
(package private) RssParserImpl090(churchillobjects.rss4j.RssDocument document, java.util.Vector namespaces)
          Constructor for this RSS verion's parser.
 
Method Summary
private  void closeChannelElement()
          Upon close of channel element, adds the current channel to the document, sets it to null and sets the inChannel flag to false.
private  void closeImageElement()
          Upon close of image element, adds the current image to the channel, sets it to null and sets the inImage flag to false.
private  void closeItemElement()
          Upon close of item element, adds the current item to the channel, sets it to null and sets the inItem flag to false.
private  void closeTextInputElement()
          Upon close of TextInput element, adds the current text input to the channel, sets it to null and sets the inTextInput flag to false.
 void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName)
          SAX interface method.
private  void handleDescriptionAttribute()
          Handles the description attribute by adding the characters to the current text input or channel, depending on the flags.
private  void handleLinkAttribute()
          Handles the link attribute by adding the characters to the current text input, image, item or channel, depending on the flags.
private  void handleNameAttribute()
          Handles the name attribute by adding the characters to the current text input if that flag is set.
private  void handleTitleAttribute()
          Handles the title attribute by adding the characters to the current text input, image, item or channel, depending on the flags.
private  void handleUrlAttribute()
          Handles the url attribute by adding the characters to the current image if that flag is set.
 void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs)
          SAX interface method.
 
Methods inherited from class churchillobjects.rss4j.parser.RssParser
characters, cleanUp, getAttribute, getChars, hasChars, parseRss, parseRss, parseRss, parseRss, parseRss, resetChars, startPrefixMapping
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inChannel

protected boolean inChannel
Indicates that the SAX handling process is currently in a channel.


inItem

protected boolean inItem
Indicates that the SAX handling process is currently in an item.


inTextInput

protected boolean inTextInput
Indicates that the SAX handling process is currently in a text input.


inImage

protected boolean inImage
Indicates that the SAX handling process is currently in an image.


VERSION

private static final java.lang.String VERSION
Hard-coded version number for this handler's RSS version.

See Also:
Constant Field Values
Constructor Detail

RssParserImpl090

RssParserImpl090(churchillobjects.rss4j.RssDocument document,
                 java.util.Vector namespaces)
Constructor for this RSS verion's parser. Provided with an already set-up document and namespace.

Parameters:
document -
namespaces -
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String name,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
SAX interface method. Creates containers for channel, item, textinput and image and sets flags to indicate that we are within that element.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class RssParser
Parameters:
uri -
name -
qName -
attrs -
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String name,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
SAX interface method. Upon closing an element, add that element to the document (or containing element) and set the flags to indicate we are no longer within that element. For attributes of elements, set the characters to the containing element.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
uri -
name -
qName -
Throws:
org.xml.sax.SAXException

closeChannelElement

private void closeChannelElement()
Upon close of channel element, adds the current channel to the document, sets it to null and sets the inChannel flag to false.


closeItemElement

private void closeItemElement()
Upon close of item element, adds the current item to the channel, sets it to null and sets the inItem flag to false.


closeTextInputElement

private void closeTextInputElement()
Upon close of TextInput element, adds the current text input to the channel, sets it to null and sets the inTextInput flag to false.


closeImageElement

private void closeImageElement()
Upon close of image element, adds the current image to the channel, sets it to null and sets the inImage flag to false.


handleTitleAttribute

private void handleTitleAttribute()
Handles the title attribute by adding the characters to the current text input, image, item or channel, depending on the flags.


handleDescriptionAttribute

private void handleDescriptionAttribute()
Handles the description attribute by adding the characters to the current text input or channel, depending on the flags.


handleLinkAttribute

private void handleLinkAttribute()
Handles the link attribute by adding the characters to the current text input, image, item or channel, depending on the flags.


handleUrlAttribute

private void handleUrlAttribute()
Handles the url attribute by adding the characters to the current image if that flag is set.


handleNameAttribute

private void handleNameAttribute()
Handles the name attribute by adding the characters to the current text input if that flag is set.


Copyright (c) 2000-2002 ChurchillObjects.com