org.apache.wink.common.model.rss
Class RssItem

java.lang.Object
  extended by org.apache.wink.common.model.rss.RssItem

public class RssItem
extends Object

Java class for "item" element of RSS 2.0 Specification.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="rssItem">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
         <element name="link" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
         <element name="author" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
         <element name="category" type="{}rssCategory" maxOccurs="unbounded" minOccurs="0"/>
         <element name="comments" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
         <element name="enclosure" type="{}rssEnclosure" minOccurs="0"/>
         <element name="guid" type="{}rssGuid" minOccurs="0"/>
         <element name="pubDate" type="{http://www.w3.org/2001/XMLSchema}string"/>
         <element name="source" type="{}rssSource" minOccurs="0"/>
         <any/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 

Elements of <item>

A channel may contain any number of <item>s. An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed; see examples), and the link and title may be omitted. All elements of an item are optional, however at least one of title or description must be present.

Element Description Example
title The title of the item. Venice Film Festival Tries to Quit Sinking
link The URL of the item. http://nytimes.com/2004/12/07FEST.html
description The item synopsis. <description>Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged.</description>
author Email address of the author of the item. For newspapers and magazines syndicating via RSS, the author is the person who wrote the article that the <item> describes. For collaborative weblogs, the author of the item might be different from the managing editor or webmaster. For a weblog authored by a single individual it would make sense to omit the <author> element. <author>lawyer@boyer.net (Lawyer Boyer)</author>
category Includes the item in one or more categories. More here.
comments URL of a page for comments relating to the item. More here.. <comments>http://ekzemplo.com/entry/4403/comments</comments>
enclosure Describes a media object that is attached to the item. More here.
guid A string that uniquely identifies the item. More here.
pubDate Indicates when the item was published. If it's a date in the future, aggregators may choose to not display the item until that date. <pubDate>Sun, 19 May 2002 15:21:36 GMT</pubDate>
source The RSS channel that the item came from. More here .


Field Summary
protected  List<Object> any
           
protected  String author
           
protected  List<RssCategory> category
           
protected  String comments
           
protected  String description
           
protected  RssEnclosure enclosure
           
protected  RssGuid guid
           
protected  String link
           
protected  String pubDate
           
protected  RssSource source
           
protected  String title
           
 
Constructor Summary
RssItem()
          Creates an RssItem object
RssItem(SyndEntry syndEntry)
          Creates an RssItem object out of a SyndEntry object.
 
Method Summary
 List<Object> getAny()
          Gets the value of the any property.
 String getAuthor()
          Gets the value of the author property.
 List<RssCategory> getCategories()
          Gets the value of the category property.
 String getComments()
          Gets the value of the comments property.
 String getDescription()
          Gets the value of the description property.
 RssEnclosure getEnclosure()
          Gets the value of the enclosure property.
 RssGuid getGuid()
          Gets the value of the guid property.
 String getLink()
          Gets the value of the link property.
 String getPubDate()
          Gets the value of the pubDate property.
 RssSource getSource()
          Gets the value of the source property.
 String getTitle()
          Gets the value of the title property.
 void setAuthor(String value)
          Sets the value of the author property.
 void setComments(String value)
          Sets the value of the comments property.
 void setDescription(String value)
          Sets the value of the description property.
 void setEnclosure(RssEnclosure value)
          Sets the value of the enclosure property.
 void setGuid(RssGuid value)
          Sets the value of the guid property.
 void setLink(String value)
          Sets the value of the link property.
 void setPubDate(String value)
          Sets the value of the pubDate property.
 void setSource(RssSource value)
          Sets the value of the source property.
 void setTitle(String value)
          Sets the value of the title property.
 SyndEntry toSynd(SyndEntry syndEntry)
          Maps an RssItem object into a SyndEntry object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

title

protected String title

link

protected String link

description

protected String description

author

protected String author

category

protected List<RssCategory> category

comments

protected String comments

enclosure

protected RssEnclosure enclosure

guid

protected RssGuid guid

pubDate

protected String pubDate

source

protected RssSource source

any

protected List<Object> any
Constructor Detail

RssItem

public RssItem()
Creates an RssItem object


RssItem

public RssItem(SyndEntry syndEntry)
Creates an RssItem object out of a SyndEntry object. Used for mapping Syndication Object Model into RSS.

Parameters:
syndEntry - the SyndEntry object which has to be mapped into an RssItem object.
Method Detail

toSynd

public SyndEntry toSynd(SyndEntry syndEntry)
Maps an RssItem object into a SyndEntry object. Used for mapping RSS into Syndication Object Model.

Parameters:
syndEntry - the SyndEntry object into which the given RssItem object has to be mapped into
Returns:
the SyndEntry object into which the given RssItem object has been mapped into

getTitle

public String getTitle()
Gets the value of the title property.

Returns:
possible object is String

setTitle

public void setTitle(String value)
Sets the value of the title property.

Parameters:
value - allowed object is String

getLink

public String getLink()
Gets the value of the link property.

Returns:
possible object is String

setLink

public void setLink(String value)
Sets the value of the link property.

Parameters:
value - allowed object is String

getDescription

public String getDescription()
Gets the value of the description property.

Returns:
possible object is String

setDescription

public void setDescription(String value)
Sets the value of the description property.

Parameters:
value - allowed object is String

getAuthor

public String getAuthor()
Gets the value of the author property.

Returns:
possible object is String

setAuthor

public void setAuthor(String value)
Sets the value of the author property.

Parameters:
value - allowed object is String

getCategories

public List<RssCategory> getCategories()
Gets the value of the category property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the category property.

For example, to add a new item, do as follows:

 getCategories().add(newItem);
 

Objects of the following type(s) are allowed in the list RssCategory


getComments

public String getComments()
Gets the value of the comments property.

Returns:
possible object is String

setComments

public void setComments(String value)
Sets the value of the comments property.

Parameters:
value - allowed object is String

getEnclosure

public RssEnclosure getEnclosure()
Gets the value of the enclosure property.

Returns:
possible object is RssEnclosure

setEnclosure

public void setEnclosure(RssEnclosure value)
Sets the value of the enclosure property.

Parameters:
value - allowed object is RssEnclosure

getGuid

public RssGuid getGuid()
Gets the value of the guid property.

Returns:
possible object is RssGuid

setGuid

public void setGuid(RssGuid value)
Sets the value of the guid property.

Parameters:
value - allowed object is RssGuid

getPubDate

public String getPubDate()
Gets the value of the pubDate property.

Returns:
possible object is String

setPubDate

public void setPubDate(String value)
Sets the value of the pubDate property.

Parameters:
value - allowed object is String

getSource

public RssSource getSource()
Gets the value of the source property.

Returns:
possible object is RssSource

setSource

public void setSource(RssSource value)
Sets the value of the source property.

Parameters:
value - allowed object is RssSource

getAny

public List<Object> getAny()
Gets the value of the any property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the any property.

For example, to add a new item, do as follows:

 getAny().add(newItem);
 

Objects of the following type(s) are allowed in the list Object



Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.