Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.syndication.feed.synd
Class SyndFeedImpl  view SyndFeedImpl download SyndFeedImpl.java

java.lang.Object
  extended bycom.sun.syndication.feed.synd.SyndFeedImpl
All Implemented Interfaces:
java.lang.Cloneable, com.sun.syndication.feed.CopyFrom, java.io.Serializable, SyndFeed

public class SyndFeedImpl
extends java.lang.Object
implements java.io.Serializable, SyndFeed

Bean for all types of feeds.

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


Field Summary
private  java.util.List _authors
           
private  java.util.List _contributors
           
private  java.lang.String _description
           
private  java.lang.String _encoding
           
private  java.util.List _entries
           
private  java.lang.String _feedType
           
private  SyndImage _image
           
private  java.lang.String _link
           
private  java.util.List _links
           
private  java.util.List _modules
           
private  com.sun.syndication.feed.impl.ObjectBean _objBean
           
private  java.lang.String _title
           
private  java.lang.String _uri
           
static java.util.Set CONVENIENCE_PROPERTIES
          Unmodifiable Set containing the convenience properties of this class.
private static com.sun.syndication.feed.synd.impl.Converters CONVERTERS
           
private static com.sun.syndication.feed.impl.CopyFromHelper COPY_FROM_HELPER
           
private static java.util.Set IGNORE_PROPERTIES
           
 
Constructor Summary
  SyndFeedImpl()
          Default constructor.
protected SyndFeedImpl(java.lang.Class beanClass, java.util.Set convenienceProperties)
          For implementations extending SyndFeedImpl to be able to use the ObjectBean functionality with extended interfaces.
  SyndFeedImpl(com.sun.syndication.feed.WireFeed feed)
          Creates a SyndFeedImpl and populates all its properties out of the given RSS Channel or Atom Feed properties.
 
Method Summary
 java.lang.Object clone()
          Creates a deep 'bean' clone of the object.
 void copyFrom(java.lang.Object obj)
          Copies all the properties of the given bean into this one.
 com.sun.syndication.feed.WireFeed createWireFeed()
          Creates a real feed containing the information of the SyndFeedImpl.
 com.sun.syndication.feed.WireFeed createWireFeed(java.lang.String feedType)
          Creates a real feed containing the information of the SyndFeedImpl.
 boolean equals(java.lang.Object other)
          Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
 java.lang.String getAuthor()
          Returns the feed author.
 java.util.List getAuthors()
          Returns the feed authors.
 java.util.List getCategories()
          Returns the feed categories.
 java.util.List getContributors()
          Returns the feed author.
 java.lang.String getCopyright()
          Returns the feed copyright.
private  com.sun.syndication.feed.module.DCModule getDCModule()
          Returns the Dublin Core module of the feed.
 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.
 SyndImage 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.
 java.util.List getLinks()
          Returns the links
 com.sun.syndication.feed.module.Module 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 SyndFeedImpl supports when converting from and to.
 java.lang.String getTitle()
          Returns the feed title.
 java.lang.String getUri()
          Returns the feed URI.
 int hashCode()
          Returns a hashcode value for the object.
 void setAuthor(java.lang.String author)
          Sets the feed author.
 void setAuthors(java.util.List authors)
          Sets the feed author.
 void setCategories(java.util.List categories)
          Sets the feed categories.
 void setContributors(java.util.List contributors)
          Sets the feed author.
 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(SyndImage 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 setLinks(java.util.List links)
          Set the links
 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.
 void setUri(java.lang.String uri)
          Sets the feed URI.
 java.lang.String toString()
          Returns the String representation for the object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_objBean

private com.sun.syndication.feed.impl.ObjectBean _objBean

_encoding

private java.lang.String _encoding

_uri

private java.lang.String _uri

_title

private java.lang.String _title

_feedType

private java.lang.String _feedType

_link

private java.lang.String _link

_links

private java.util.List _links

_description

private java.lang.String _description

_image

private SyndImage _image

_entries

private java.util.List _entries

_modules

private java.util.List _modules

_authors

private java.util.List _authors

_contributors

private java.util.List _contributors

CONVERTERS

private static final com.sun.syndication.feed.synd.impl.Converters CONVERTERS

IGNORE_PROPERTIES

private static final java.util.Set IGNORE_PROPERTIES

CONVENIENCE_PROPERTIES

public static final java.util.Set CONVENIENCE_PROPERTIES
Unmodifiable Set containing the convenience properties of this class.

Convenience properties are mapped to Modules, for cloning the convenience properties can be ignored as the will be copied as part of the module cloning.


COPY_FROM_HELPER

private static final com.sun.syndication.feed.impl.CopyFromHelper COPY_FROM_HELPER
Constructor Detail

SyndFeedImpl

protected SyndFeedImpl(java.lang.Class beanClass,
                       java.util.Set convenienceProperties)
For implementations extending SyndFeedImpl to be able to use the ObjectBean functionality with extended interfaces.


SyndFeedImpl

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


SyndFeedImpl

public SyndFeedImpl(com.sun.syndication.feed.WireFeed feed)
Creates a SyndFeedImpl and populates all its properties out of the given RSS Channel or Atom Feed properties.

Method Detail

getSupportedFeedTypes

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

Specified by:
getSupportedFeedTypes in interface SyndFeed

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a deep 'bean' clone of the object.

Specified by:
clone in interface SyndFeed

equals

public boolean equals(java.lang.Object other)
Indicates whether some other object is "equal to" this one as defined by the Object equals() method.


hashCode

public int hashCode()
Returns a hashcode value for the object.

It follows the contract defined by the Object hashCode() method.


toString

public java.lang.String toString()
Returns the String representation for the object.


createWireFeed

public com.sun.syndication.feed.WireFeed createWireFeed()
Creates a real feed containing the information of the SyndFeedImpl.

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

Specified by:
createWireFeed in interface SyndFeed

createWireFeed

public com.sun.syndication.feed.WireFeed createWireFeed(java.lang.String feedType)
Creates a real feed containing the information of the SyndFeedImpl.

Specified by:
createWireFeed in interface SyndFeed

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 SyndFeed

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 SyndFeed

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 SyndFeed

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 SyndFeed

getUri

public java.lang.String getUri()
Returns the feed URI.

How the feed URI maps to a concrete feed type (RSS or Atom) depends on the concrete feed type. This is explained in detail in Rome documentation, Feed and entry URI mapping.

The returned URI is a normalized URI as specified in RFC 2396bis.

Note: The URI is the unique identifier, in the RSS 2.0/atom case this is the GUID, for RSS 1.0 this is the URI attribute of the item. The Link is the URL that the item is accessible under, the URI is the permanent identifier which the aggregator should use to reference this item. Often the URI will use some standardized identifier scheme such as DOI's so that items can be identified even if they appear in multiple feeds with different "links" (they might be on different hosting platforms but be the same item). Also, though rare, there could be multiple items with the same link but a different URI and associated metadata which need to be treated as distinct entities. In the RSS 1.0 case the URI must be a valid RDF URI reference.

Specified by:
getUri in interface SyndFeed

setUri

public void setUri(java.lang.String uri)
Sets the feed URI.

How the feed URI maps to a concrete feed type (RSS or Atom) depends on the concrete feed type. This is explained in detail in Rome documentation, Feed and entry URI mapping.

Note: The URI is the unique identifier, in the RSS 2.0/atom case this is the GUID, for RSS 1.0 this is the URI attribute of the item. The Link is the URL that the item is accessible under, the URI is the permanent identifier which the aggregator should use to reference this item. Often the URI will use some standardized identifier scheme such as DOI's so that items can be identified even if they appear in multiple feeds with different "links" (they might be on different hosting platforms but be the same item). Also, though rare, there could be multiple items with the same link but a different URI and associated metadata which need to be treated as distinct entities. In the RSS 1.0 case the URI must be a valid RDF URI reference.

Specified by:
setUri in interface SyndFeed

getTitle

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

Specified by:
getTitle in interface SyndFeed

setTitle

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

Specified by:
setTitle in interface SyndFeed

getLink

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

Note: The URI is the unique identifier, in the RSS 2.0/atom case this is the GUID, for RSS 1.0 this is the URI attribute of the item. The Link is the URL that the item is accessible under, the URI is the permanent identifier which the aggregator should use to reference this item. Often the URI will use some standardized identifier scheme such as DOI's so that items can be identified even if they appear in multiple feeds with different "links" (they might be on different hosting platforms but be the same item). Also, though rare, there could be multiple items with the same link but a different URI and associated metadata which need to be treated as distinct entities. In the RSS 1.0 case the URI must be a valid RDF URI reference.

Specified by:
getLink in interface SyndFeed

setLink

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

Note: The URI is the unique identifier, in the RSS 2.0/atom case this is the GUID, for RSS 1.0 this is the URI attribute of the item. The Link is the URL that the item is accessible under, the URI is the permanent identifier which the aggregator should use to reference this item. Often the URI will use some standardized identifier scheme such as DOI's so that items can be identified even if they appear in multiple feeds with different "links" (they might be on different hosting platforms but be the same item). Also, though rare, there could be multiple items with the same link but a different URI and associated metadata which need to be treated as distinct entities. In the RSS 1.0 case the URI must be a valid RDF URI reference.

Specified by:
setLink in interface SyndFeed

getDescription

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

Specified by:
getDescription in interface SyndFeed

setDescription

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

Specified by:
setDescription in interface SyndFeed

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 SyndFeed

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 SyndFeed

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 SyndFeed

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 SyndFeed

getImage

public SyndImage getImage()
Returns the feed image.

Specified by:
getImage in interface SyndFeed

setImage

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

Specified by:
setImage in interface SyndFeed

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 SyndFeed

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 SyndFeed

getEntries

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

Specified by:
getEntries in interface SyndFeed

setEntries

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

Specified by:
setEntries in interface SyndFeed

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 SyndFeed

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 SyndFeed

getModules

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

Specified by:
getModules in interface SyndFeed

setModules

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

Specified by:
setModules in interface SyndFeed

getModule

public com.sun.syndication.feed.module.Module getModule(java.lang.String uri)
Returns the module identified by a given URI.

Specified by:
getModule in interface SyndFeed

getDCModule

private com.sun.syndication.feed.module.DCModule getDCModule()
Returns the Dublin Core module of the feed.


getInterface

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

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

Specified by:
getInterface in interface com.sun.syndication.feed.CopyFrom

copyFrom

public void copyFrom(java.lang.Object obj)
Description copied from interface: com.sun.syndication.feed.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 SyndFeed bean implementation to a Hibernate ready implementation.

Specified by:
copyFrom in interface com.sun.syndication.feed.CopyFrom

getLinks

public java.util.List getLinks()
Returns the links

Specified by:
getLinks in interface SyndFeed

setLinks

public void setLinks(java.util.List links)
Set the links

Specified by:
setLinks in interface SyndFeed

getAuthors

public java.util.List getAuthors()
Description copied from interface: SyndFeed
Returns the feed authors.

For Atom feeds, this returns the authors as a list of SyndPerson objects, for RSS feeds this method is a convenience method, it maps to the Dublin Core module creator.

Specified by:
getAuthors in interface SyndFeed

setAuthors

public void setAuthors(java.util.List authors)
Description copied from interface: SyndFeed
Sets the feed author.

For Atom feeds, this sets the authors as a list of SyndPerson objects, for RSS feeds this method is a convenience method, it maps to the Dublin Core module creator.

Specified by:
setAuthors in interface SyndFeed

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 SyndFeed

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 SyndFeed

getContributors

public java.util.List getContributors()
Description copied from interface: SyndFeed
Returns the feed author.

For Atom feeds, this returns the contributors as a list of SyndPerson objects

Specified by:
getContributors in interface SyndFeed

setContributors

public void setContributors(java.util.List contributors)
Description copied from interface: SyndFeed
Sets the feed author.

Returns contributors as a list of SyndPerson objects.

Specified by:
setContributors in interface SyndFeed