com.sun.syndication.feed.synd
Class SyndFeed

java.lang.Object
  extended bycom.sun.syndication.common.ObjectBean
      extended bycom.sun.syndication.feed.synd.SyndFeed
All Implemented Interfaces:
java.lang.Cloneable, CopyFrom, java.io.Serializable, SyndFeedI, ToString

public class SyndFeed
extends ObjectBean
implements SyndFeedI

Bean for all types of feeds.

It handles all RSS versions and Atom 0.3, it normalizes all info, it may lose information.

Author:
Alejandro Abdelnur
See Also:
Serialized Form

Constructor Summary
SyndFeed()
          Default constructor.
SyndFeed(WireFeed feed)
          Creates a SyndFeed an populates all its properties out of the given RSS Channel or Atom Feed properties.
 
Method Summary
 void copyFrom(java.lang.Object obj)
          Copies all the properties of the given bean into this one.
 WireFeed createWireFeed()
          Creates a real feed containing the information of the SyndFeed.
 WireFeed createWireFeed(java.lang.String feedType)
          Creates a real feed containing the information of the SyndFeed.
 java.lang.String getAuthor()
          Returns the feed author.
 java.util.List getCategories()
          Returns the feed categories.
 java.lang.String getCopyright()
          Returns the feed copyright.
 java.lang.String getDescription()
          Returns the feed description.
 java.lang.String getEncoding()
          Returns the charset encoding of a the feed.
 java.util.List getEntries()
          Returns the feed entries.
 java.lang.String getFeedType()
          Returns the wire feed type the feed had/will-have when coverted from/to a WireFeed.
 SyndImageI getImage()
          Returns the feed image.
 java.lang.Class getInterface()
          Returns the interface the copyFrom works on.
 java.lang.String getLanguage()
          Returns the feed language.
 java.lang.String getLink()
          Returns the feed link.
 ModuleI getModule(java.lang.String uri)
          Returns the module identified by a given URI.
 java.util.List getModules()
          Returns the feed modules.
 java.util.Date getPublishedDate()
          Returns the feed published date.
 java.util.List getSupportedFeedTypes()
          Returns the real feed types the SyndFeed supports when converting from and to.
 java.lang.String getTitle()
          Returns the feed title.
 void setAuthor(java.lang.String author)
          Sets the feed author.
 void setCategories(java.util.List categories)
          Sets the feed categories.
 void setCopyright(java.lang.String copyright)
          Sets the feed copyright.
 void setDescription(java.lang.String description)
          Sets the feed description.
 void setEncoding(java.lang.String encoding)
          Sets the charset encoding of a the feed.
 void setEntries(java.util.List entries)
          Sets the feed entries.
 void setFeedType(java.lang.String feedType)
          Sets the wire feed type the feed will-have when coverted to a WireFeed.
 void setImage(SyndImageI image)
          Sets the feed image.
 void setLanguage(java.lang.String language)
          Sets the feed language.
 void setLink(java.lang.String link)
          Sets the feed link.
 void setModules(java.util.List modules)
          Sets the feed modules.
 void setPublishedDate(java.util.Date publishedDate)
          Sets the feed published date.
 void setTitle(java.lang.String title)
          Sets the feed title.
 
Methods inherited from class com.sun.syndication.common.ObjectBean
clone, equals, hashCode, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.syndication.feed.synd.SyndFeedI
clone
 
Methods inherited from interface com.sun.syndication.common.ToString
toString
 

Constructor Detail

SyndFeed

public SyndFeed()
Default constructor. All properties are set to null.


SyndFeed

public SyndFeed(WireFeed feed)
Creates a SyndFeed an populates all its properties out of the given RSS Channel or Atom Feed properties.

Parameters:
feed - the RSS Channel or the Atom Feed to populate the properties from.
Method Detail

getSupportedFeedTypes

public java.util.List getSupportedFeedTypes()
Returns the real feed types the SyndFeed supports when converting from and to.

Specified by:
getSupportedFeedTypes in interface SyndFeedI
Returns:
the real feed type supported.

createWireFeed

public WireFeed createWireFeed()
Creates a real feed containing the information of the SyndFeed.

The feed type of the created WireFeed is taken from the SyndFeed feedType property.

Specified by:
createWireFeed in interface SyndFeedI
Returns:
the real feed.

createWireFeed

public WireFeed createWireFeed(java.lang.String feedType)
Creates a real feed containing the information of the SyndFeed.

Specified by:
createWireFeed in interface SyndFeedI
Parameters:
feedType - the feed type for the WireFeed to be created.
Returns:
the real feed.

getFeedType

public java.lang.String getFeedType()
Returns the wire feed type the feed had/will-have when coverted from/to a WireFeed.

Specified by:
getFeedType in interface SyndFeedI
Returns:
the feed type, null if none.

setFeedType

public void setFeedType(java.lang.String feedType)
Sets the wire feed type the feed will-have when coverted to a WireFeed.

Specified by:
setFeedType in interface SyndFeedI
Parameters:
feedType - the feed type to set, null if none.

getEncoding

public java.lang.String getEncoding()
Returns the charset encoding of a the feed. This is not set by Rome parsers.

Specified by:
getEncoding in interface SyndFeedI
Returns:
the charset encoding of the feed.

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the charset encoding of a the feed. This is not set by Rome parsers.

Specified by:
setEncoding in interface SyndFeedI
Parameters:
encoding - the charset encoding of the feed.

getTitle

public java.lang.String getTitle()
Returns the feed title.

Specified by:
getTitle in interface SyndFeedI
Returns:
the feed title, null if none.

setTitle

public void setTitle(java.lang.String title)
Sets the feed title.

Specified by:
setTitle in interface SyndFeedI
Parameters:
title - the feed title to set, null if none.

getLink

public java.lang.String getLink()
Returns the feed link.

Specified by:
getLink in interface SyndFeedI
Returns:
the feed link, null if none.

setLink

public void setLink(java.lang.String link)
Sets the feed link.

Specified by:
setLink in interface SyndFeedI
Parameters:
link - the feed link to set, null if none.

getDescription

public java.lang.String getDescription()
Returns the feed description.

Specified by:
getDescription in interface SyndFeedI
Returns:
the feed description, null if none.

setDescription

public void setDescription(java.lang.String description)
Sets the feed description.

Specified by:
setDescription in interface SyndFeedI
Parameters:
description - the feed description to set, null if none.

getPublishedDate

public java.util.Date getPublishedDate()
Returns the feed published date.

This method is a convenience method, it maps to the Dublin Core module date.

Specified by:
getPublishedDate in interface SyndFeedI
Returns:
the feed published date, null if none.

setPublishedDate

public void setPublishedDate(java.util.Date publishedDate)
Sets the feed published date.

This method is a convenience method, it maps to the Dublin Core module date.

Specified by:
setPublishedDate in interface SyndFeedI
Parameters:
publishedDate - the feed published date to set, null if none.

getAuthor

public java.lang.String getAuthor()
Returns the feed author.

This method is a convenience method, it maps to the Dublin Core module creator.

Specified by:
getAuthor in interface SyndFeedI
Returns:
the feed author, null if none.

setAuthor

public void setAuthor(java.lang.String author)
Sets the feed author.

This method is a convenience method, it maps to the Dublin Core module creator.

Specified by:
setAuthor in interface SyndFeedI
Parameters:
author - the feed author to set, null if none.

getCopyright

public java.lang.String getCopyright()
Returns the feed copyright.

This method is a convenience method, it maps to the Dublin Core module rights.

Specified by:
getCopyright in interface SyndFeedI
Returns:
the feed copyright, null if none.

setCopyright

public void setCopyright(java.lang.String copyright)
Sets the feed copyright.

This method is a convenience method, it maps to the Dublin Core module rights.

Specified by:
setCopyright in interface SyndFeedI
Parameters:
copyright - the feed copyright to set, null if none.

getImage

public SyndImageI getImage()
Returns the feed image.

Specified by:
getImage in interface SyndFeedI
Returns:
the feed image, null if none.

setImage

public void setImage(SyndImageI image)
Sets the feed image.

Specified by:
setImage in interface SyndFeedI
Parameters:
image - the feed image to set, null if none.

getCategories

public java.util.List getCategories()
Returns the feed categories.

This method is a convenience method, it maps to the Dublin Core module subjects.

Specified by:
getCategories in interface SyndFeedI
Returns:
a list of SyndCategory elements with the feed categories, an empty list if none.

setCategories

public void setCategories(java.util.List categories)
Sets the feed categories.

This method is a convenience method, it maps to the Dublin Core module subjects.

Specified by:
setCategories in interface SyndFeedI
Parameters:
categories - the list of SyndCategory elements with the feed categories to set, an empty list or null if none.

getEntries

public java.util.List getEntries()
Returns the feed entries.

Specified by:
getEntries in interface SyndFeedI
Returns:
a list of SyndEntry elements with the feed entries, an empty list if none.

setEntries

public void setEntries(java.util.List entries)
Sets the feed entries.

Specified by:
setEntries in interface SyndFeedI
Parameters:
entries - the list of SyndEntry elements with the feed entries to set, an empty list or null if none.

getLanguage

public java.lang.String getLanguage()
Returns the feed language.

This method is a convenience method, it maps to the Dublin Core module language.

Specified by:
getLanguage in interface SyndFeedI
Returns:
the feed language, null if none.

setLanguage

public void setLanguage(java.lang.String language)
Sets the feed language.

This method is a convenience method, it maps to the Dublin Core module language.

Specified by:
setLanguage in interface SyndFeedI
Parameters:
language - the feed language to set, null if none.

getModules

public java.util.List getModules()
Returns the feed modules.

Specified by:
getModules in interface SyndFeedI
Returns:
a list of Module elements with the feed modules, an empty list if none.

setModules

public void setModules(java.util.List modules)
Sets the feed modules.

Specified by:
setModules in interface SyndFeedI
Parameters:
modules - the list of Module elements with the feed modules to set, an empty list or null if none.

getModule

public ModuleI getModule(java.lang.String uri)
Returns the module identified by a given URI.

Specified by:
getModule in interface SyndFeedI
Parameters:
uri - the URI of the Module.
Returns:
The module with the given URI, null if none.

getInterface

public java.lang.Class getInterface()
Description copied from interface: CopyFrom
Returns the interface the copyFrom works on.

This is useful when dealing with properties that may have multiple implementations. For example, ModuleI.

Specified by:
getInterface in interface CopyFrom
Returns:
the interface the copyFrom works on.

copyFrom

public void copyFrom(java.lang.Object obj)
Description copied from interface: CopyFrom
Copies all the properties of the given bean into this one.

Any existing properties in this bean are lost.

This method is useful for moving from one implementation of a bean interface to another. For example from the default SyndFeedI bean implementation to a Hibernate ready implementation.

Specified by:
copyFrom in interface CopyFrom
Parameters:
obj - the instance to copy properties from.


Copyright © 2004 Sun Microsystems. All Rights Reserved.