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

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

public class RssFeed
extends Object

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

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

 <complexType>
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="channel" type="{}rssChannel"/>
       </sequence>
       <attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     </restriction>
   </complexContent>
 </complexType>
 

At the top level, a RSS document is a <rss> element, with a mandatory attribute called version, that specifies the version of RSS that the document conforms to. If it conforms to RSS 2.0 specification, the version attribute must be 2.0.

Subordinate to the <rss> element is a single <channel> element, which contains information about the channel (metadata) and its contents.

See Also:
RssChannel.

Field Summary
protected  RssChannel channel
           
protected  String version
           
 
Constructor Summary
RssFeed()
          Creates an RssFeed object
RssFeed(SyndFeed syndFeed)
          Creates an RssFeed object out of a SyndFeed object.
 
Method Summary
 RssChannel getChannel()
          Gets the value of the channel property.
 String getVersion()
          Gets the value of the version property.
 void setChannel(RssChannel value)
          Sets the value of the channel property.
 void setVersion(String value)
          Sets the value of the version property.
 SyndFeed toSynd(SyndFeed syndFeed)
          Maps RssFeed into Syndication Object Model (SyndFeed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

protected RssChannel channel

version

protected String version
Constructor Detail

RssFeed

public RssFeed()
Creates an RssFeed object


RssFeed

public RssFeed(SyndFeed syndFeed)
Creates an RssFeed object out of a SyndFeed object. Used for mapping Syndication Object Model into RSS.

Parameters:
syndFeed - the SyndFeed object which has to be mapped into an RSS object
Method Detail

toSynd

public SyndFeed toSynd(SyndFeed syndFeed)
Maps RssFeed into Syndication Object Model (SyndFeed). This enables the common SyndFeed APIs to be used for reading both RSS and Atom documents.
 ...
 // perform a GET on the RSS resource. The resource will be returned as an Rss object
 RssFeed rssFeed = resource.accept(MediaType.APPLICATION_XML).get(RssFeed.class);
 
 // Map RSS into SyndFeed
 SyndFeed syndFeed = new SyndFeed();
 syndFeed = rssFeed.toSynd(syndFeed);
 
 // Now access RSS using SyndFeed APIs
 ...
 

Parameters:
syndFeed - the SyndFeed object into which the given RSS object has to be mapped into
Returns:
the SyndFeed object into which the given RSS object has been mapped into

getChannel

public RssChannel getChannel()
Gets the value of the channel property.

Returns:
possible object is RssChannel

setChannel

public void setChannel(RssChannel value)
Sets the value of the channel property.

Parameters:
value - allowed object is RssChannel

getVersion

public String getVersion()
Gets the value of the version property.

Returns:
possible object is String

setVersion

public void setVersion(String value)
Sets the value of the version property.

Parameters:
value - allowed object is String


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