com.sun.syndication.feed.synd

## Class SyndFeedImpl

- java.lang.Object
- - com.sun.syndication.feed.synd.SyndFeedImpl

All Implemented Interfaces:
  CopyFrom, Extendable, SyndFeed, java.io.Serializable, java.lang.Cloneable

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

Bean for all types of feeds.

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

See Also:
  Serialized Form

### Field Summary

Fields
`static java.util.Set` `CONVENIENCE_PROPERTIES` Unmodifiable Set containing the convenience properties of this class.

### Constructor Summary

Constructors
`` `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(WireFeed feed)` Creates a SyndFeedImpl and populates all its properties out of the given RSS Channel or Atom Feed properties.
`` `SyndFeedImpl(WireFeed feed, boolean preserveWireFeed)` Creates a SyndFeedImpl and populates all its properties out of the given RSS Channel or Atom Feed properties, while optionally preserving the WireFeed for access via the orignalWireFeed() method.

### Method Summary

Methods
`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.
`WireFeed` `createWireFeed()` Creates a real feed containing the information of the SyndFeedImpl.
`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.
`java.lang.String` `getDescription()` Returns the feed description.
`SyndContent` `getDescriptionEx()` Returns the feed description as a text construct.
`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.
`java.lang.Object` `getForeignMarkup()` Returns foreign markup found at channel level.
`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
`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.
`SyndContent` `getTitleEx()` Returns the feed title as a text construct.
`java.lang.String` `getUri()` Returns the feed URI.
`int` `hashCode()` Returns a hashcode value for the object.
`boolean` `isPreservingWireFeed()`
`WireFeed` `originalWireFeed()` Returns the WireFeed this SyndFeed was created from.
`void` `setAuthor(java.lang.String author)` Sets the feed author.
`void` `setAuthors(java.util.List authors)` Sets the feed authors.
`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` `setDescriptionEx(SyndContent description)` Sets the feed description as a text construct.
`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` `setForeignMarkup(java.lang.Object foreignMarkup)` Sets foreign markup found at channel level.
`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` `setTitleEx(SyndContent title)` Sets the feed title as a text construct.
`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

#### 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.

### 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.

Parameters:
  `beanClass` -
  `convenienceProperties` - set containing the convenience properties of the SyndEntryImpl (the are ignored during cloning, check CloneableBean for details).

#### SyndFeedImpl

    public SyndFeedImpl()

Default constructor. All properties are set to null.

#### SyndFeedImpl

    public SyndFeedImpl(WireFeed feed)

Creates a SyndFeedImpl and 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.

#### SyndFeedImpl

    public SyndFeedImpl(WireFeed feed,
                boolean preserveWireFeed)

Creates a SyndFeedImpl and populates all its properties out of the given RSS Channel or Atom Feed properties, while optionally preserving the WireFeed for access via the orignalWireFeed() method.

Parameters:
  `feed` -
  `preserveWireFeed` -

### 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`
Returns:
  the real feed type supported.

#### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

Creates a deep 'bean' clone of the object.

Specified by:
  `clone` in interface `SyndFeed`
Overrides:
  `clone` in class `java.lang.Object`
Returns:
  a clone of the object.
Throws:
  `java.lang.CloneNotSupportedException` - thrown if an element of the object cannot be cloned.

#### 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.

Overrides:
  `equals` in class `java.lang.Object`
Parameters:
  `other` - he reference object with which to compare.
Returns:
  true if 'this' object is equal to the 'other' object.

#### hashCode

    public int hashCode()

Returns a hashcode value for the object.

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

Overrides:
  `hashCode` in class `java.lang.Object`
Returns:
  the hashcode of the bean object.

#### toString

    public java.lang.String toString()

Returns the String representation for the object.

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  String representation for the object.

#### createWireFeed

    public 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`
Returns:
  the real feed.

#### createWireFeed

    public WireFeed createWireFeed(java.lang.String feedType)

Creates a real feed containing the information of the SyndFeedImpl.

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

#### originalWireFeed

    public WireFeed originalWireFeed()

Returns the WireFeed this SyndFeed was created from. Will return null if the original feed is not stored or if this SyndFeed was not created from a WireFeed.
Note: The wire feed returned here will NOT contain any modifications done on this SyndFeed since it was created. That is in contrast to the createWireFeed method, which will reflect the current state of the SyndFeed

Specified by:
  `originalWireFeed` in interface `SyndFeed`
Returns:
  The WireFeed this was created from, or null

#### 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`
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 `SyndFeed`
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 `SyndFeed`
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 `SyndFeed`
Parameters:
  `encoding` - the charset encoding of the feed.

#### 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`
Returns:
  the feed URI, null if none.

#### 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`
Parameters:
  `uri` - the feed URI to set, null if none.

#### getTitle

    public java.lang.String getTitle()

Returns the feed title.

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

#### setTitle

    public void setTitle(java.lang.String title)

Sets the feed title.

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

#### getTitleEx

    public SyndContent getTitleEx()

Returns the feed title as a text construct.

Specified by:
  `getTitleEx` in interface `SyndFeed`
Returns:
  the feed title, null if none.

#### setTitleEx

    public void setTitleEx(SyndContent title)

Sets the feed title as a text construct.

Specified by:
  `setTitleEx` in interface `SyndFeed`
Parameters:
  `title` - the feed title to set, null if none.

#### 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`
Returns:
  the feed link, null if none.

#### 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`
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 `SyndFeed`
Returns:
  the feed description, null if none.

#### setDescription

    public void setDescription(java.lang.String description)

Sets the feed description.

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

#### getDescriptionEx

    public SyndContent getDescriptionEx()

Returns the feed description as a text construct.

Specified by:
  `getDescriptionEx` in interface `SyndFeed`
Returns:
  the feed description, null if none.

#### setDescriptionEx

    public void setDescriptionEx(SyndContent description)

Sets the feed description as a text construct.

Specified by:
  `setDescriptionEx` in interface `SyndFeed`
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 `SyndFeed`
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 `SyndFeed`
Parameters:
  `publishedDate` - the feed published date 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 `SyndFeed`
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 `SyndFeed`
Parameters:
  `copyright` - the feed copyright to set, null if none.

#### getImage

    public SyndImage getImage()

Returns the feed image.

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

#### setImage

    public void setImage(SyndImage image)

Sets the feed image.

Specified by:
  `setImage` in interface `SyndFeed`
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 `SyndFeed`
Returns:
  a list of SyndCategoryImpl 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 `SyndFeed`
Parameters:
  `categories` - the list of SyndCategoryImpl 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 `SyndFeed`
Returns:
  a list of SyndEntryImpl 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 `SyndFeed`
Parameters:
  `entries` - the list of SyndEntryImpl 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 `SyndFeed`
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 `SyndFeed`
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 `Extendable`
Specified by:
  `getModules` in interface `SyndFeed`
Returns:
  a list of ModuleImpl 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 `Extendable`
Specified by:
  `setModules` in interface `SyndFeed`
Parameters:
  `modules` - the list of ModuleImpl elements with the feed modules to set, an empty list or null if none.

#### getModule

    public Module getModule(java.lang.String uri)

Returns the module identified by a given URI.

Specified by:
  `getModule` in interface `Extendable`
Specified by:
  `getModule` in interface `SyndFeed`
Parameters:
  `uri` - the URI of the ModuleImpl.
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, Module.

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 SyndFeed bean implementation to a Hibernate ready implementation.

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

#### getLinks

    public java.util.List getLinks()

Returns the links

Specified by:
  `getLinks` in interface `SyndFeed`
Returns:
  Returns the links.

#### setLinks

    public void setLinks(java.util.List links)

Set the links

Specified by:
  `setLinks` in interface `SyndFeed`
Parameters:
  `links` - The links to set.

#### 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`
Returns:
  the feed authors, null if none.

#### setAuthors

    public void setAuthors(java.util.List authors)

Description copied from interface: `SyndFeed`
Sets the feed authors.

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`
Parameters:
  `authors` - the feed authors 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 `SyndFeed`
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 `SyndFeed`
Parameters:
  `author` - the feed author to set, null if none.

#### 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`
Returns:
  the feed author, null if none.

#### 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`
Parameters:
  `contributors` - the feed contributors to set, null if none.

#### getForeignMarkup

    public java.lang.Object getForeignMarkup()

Returns foreign markup found at channel level.

Specified by:
  `getForeignMarkup` in interface `SyndFeed`
Returns:
  Opaque object to discourage use

#### setForeignMarkup

    public void setForeignMarkup(java.lang.Object foreignMarkup)

Sets foreign markup found at channel level.

Specified by:
  `setForeignMarkup` in interface `SyndFeed`
Parameters:
  `foreignMarkup` - Opaque object to discourage use

#### isPreservingWireFeed

    public boolean isPreservingWireFeed()

Specified by:
  `isPreservingWireFeed` in interface `SyndFeed`
Returns:
  true if this SyndFeed preserves the WireFeed it was created from