org.stringer.rss
Class Item

java.lang.Object
  |
  +--org.stringer.rss.RSSElement
        |
        +--org.stringer.rss.Item
All Implemented Interfaces:
java.io.Serializable

public class Item
extends RSSElement
implements java.io.Serializable

While commonly a news headline, with RSS 1.0's modular extensibility, this can be just about anything: discussion posting, job listing, software patch - any object with a URI. While RSS 1.0 does not enforce an upper limit, for backward compatibility with RSS 0.9 and 0.91, a maximum of fifteen items is recommended. {item_uri} must be unique with respect to any other rdf:about attributes in the RSS document and is a URI which identifies the item. {item_uri} should be identical to the value of the sub-element of the element, if possible.

See Also:
Serialized Form

Field Summary
protected  java.lang.String author
          email address of the author of the item.
protected  java.lang.String category
          Includes the item in one or more categories.
protected  java.lang.String comments
          URL of a page for comments relating to the item.
(package private)  java.lang.String creator
           
protected  java.lang.String enclosure
          Describes a media object that is attached to the item.
protected  boolean errorState
          used by the application to indicate whether the last connection attempt was a success or failure
(package private)  java.lang.String format
           
(package private)  java.lang.String guid
          A string that uniquely identifies the item.
(package private)  boolean isDirty
           
(package private)  java.lang.String language
           
private  StringerException lastErrorEvent
          when an error occurrs while reading a newsfeed, the event describing the error is placed here.
private  long lastViewed
          a stringer-specific tag
(package private) static org.apache.log4j.Logger logger
           
(package private)  Channel parent
          A channel to which this item belongs
(package private)  java.lang.String pubDate
          Indicates when the item was published.
(package private)  java.lang.String publisher
           
(package private)  java.lang.String rights
           
(package private)  java.lang.String source
          The RSS channel that the item came from Example: Quotes of the Day
(package private)  java.lang.String subject
           
 
Fields inherited from class org.stringer.rss.RSSElement
description, lastUpdateTime, link, linkURL, title, userObject
 
Constructor Summary
Item()
           
Item(Channel parent, nu.xom.Element e)
          Create a new Item
Item(java.lang.String title, java.lang.String link)
           
Item(java.lang.String title, java.lang.String link, java.lang.String description)
          Create a new news item with a title, link and description A unique identifier is assigned to the item.
 
Method Summary
 void dump()
           
 java.lang.String getAuthor()
           
 java.lang.String getCategory()
           
 Channel getChannel()
           
 java.lang.String getCommentsUrl()
           
 java.lang.String getCreator()
           
 boolean getErrorState()
           
 java.lang.String getFormat()
           
 java.lang.String getGuid()
           
 java.lang.String getLanguage()
           
 StringerException getLastErrorEvent()
           
 long getLastViewed()
           
 java.lang.String getPubDate()
           
 java.lang.String getPublisher()
           
 java.lang.String getRights()
           
 java.lang.String getSource()
           
 java.lang.String getSubject()
           
 boolean isDirty()
           
 void setChannel(Channel channel)
           
 void setDirty(boolean b)
           
 void setErrorState(boolean b)
           
 void setLastErrorEvent(StringerException e)
           
 void setLastViewed(long t)
           
 java.lang.String toString()
           
 java.lang.String toXML()
          format this item as an XML string
 
Methods inherited from class org.stringer.rss.RSSElement
buildId, decodeStringerElement, getDescription, getId, getLastUpdateTime, getLink, getLinkAsURL, getTitle, getUserObject, makeId, setDescription, setLastUpdateTime, setLink, setTitle, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger

author

protected java.lang.String author
email address of the author of the item.


errorState

protected volatile boolean errorState
used by the application to indicate whether the last connection attempt was a success or failure


category

protected java.lang.String category
Includes the item in one or more categories.


comments

protected java.lang.String comments
URL of a page for comments relating to the item.


isDirty

transient boolean isDirty

lastErrorEvent

private StringerException lastErrorEvent
when an error occurrs while reading a newsfeed, the event describing the error is placed here.


enclosure

protected java.lang.String enclosure
Describes a media object that is attached to the item. Example:


creator

java.lang.String creator

publisher

java.lang.String publisher

pubDate

java.lang.String pubDate
Indicates when the item was published.


format

java.lang.String format

language

java.lang.String language

rights

java.lang.String rights

subject

java.lang.String subject

lastViewed

private long lastViewed
a stringer-specific tag


guid

java.lang.String guid
A string that uniquely identifies the item. Example: http://inessential.com/2002/09/01.php#a2


parent

Channel parent
A channel to which this item belongs


source

java.lang.String source
The RSS channel that the item came from Example: Quotes of the Day

Constructor Detail

Item

public Item()

Item

public Item(java.lang.String title,
            java.lang.String link)

Item

public Item(java.lang.String title,
            java.lang.String link,
            java.lang.String description)
Create a new news item with a title, link and description A unique identifier is assigned to the item.

Parameters:
title - the title of this news item
link - the url string where this item can be found.
description - a description of the item.

Item

public Item(Channel parent,
            nu.xom.Element e)
Create a new Item

Method Detail

getAuthor

public java.lang.String getAuthor()
Returns:
email address of the author of this item.

getErrorState

public boolean getErrorState()

setErrorState

public void setErrorState(boolean b)

getCommentsUrl

public java.lang.String getCommentsUrl()

setDirty

public void setDirty(boolean b)

isDirty

public boolean isDirty()

getLastErrorEvent

public StringerException getLastErrorEvent()

setLastErrorEvent

public void setLastErrorEvent(StringerException e)

setLastViewed

public void setLastViewed(long t)

getLastViewed

public long getLastViewed()

setChannel

public void setChannel(Channel channel)

getCategory

public java.lang.String getCategory()

getChannel

public Channel getChannel()

getCreator

public java.lang.String getCreator()

getFormat

public java.lang.String getFormat()

getGuid

public java.lang.String getGuid()

getLanguage

public java.lang.String getLanguage()

getPublisher

public java.lang.String getPublisher()

getPubDate

public java.lang.String getPubDate()

getRights

public java.lang.String getRights()

getSource

public java.lang.String getSource()

getSubject

public java.lang.String getSubject()

dump

public void dump()
Overrides:
dump in class RSSElement

toXML

public java.lang.String toXML()
format this item as an XML string

Returns:
this item formatted as an XML String

toString

public java.lang.String toString()
Overrides:
toString in class RSSElement


Copyright © R. Kevin Cole. All Rights Reserved.