public class SyndFeedImpl extends Object implements Serializable, SyndFeed
It handles all RSS versions, Atom 0.3 and Atom 1.0, it normalizes all info, it may lose information.
Modifier and Type | Field and Description |
---|---|
static Set<String> |
CONVENIENCE_PROPERTIES
Unmodifiable Set containing the convenience properties of this class.
|
Modifier | Constructor and Description |
---|---|
|
SyndFeedImpl()
Default constructor.
|
protected |
SyndFeedImpl(Class<?> beanClass,
Set<String> 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.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a deep 'bean' clone of the object.
|
void |
copyFrom(CopyFrom 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(String feedType)
Creates a real feed containing the information of the SyndFeedImpl.
|
boolean |
equals(Object other)
Indicates whether some other object is "equal to" this one as defined by the Object equals()
method.
|
String |
getAuthor()
Returns the feed author.
|
List<SyndPerson> |
getAuthors()
Returns the feed authors.
|
List<SyndCategory> |
getCategories()
Returns the feed categories.
|
List<SyndPerson> |
getContributors()
Returns the feed author.
|
String |
getCopyright()
Returns the feed copyright.
|
String |
getDescription()
Returns the feed description.
|
SyndContent |
getDescriptionEx()
Returns the feed description as a text construct.
|
String |
getDocs()
This tag should contain a URL that references a description of the channel.
|
String |
getEncoding()
Returns the charset encoding of a the feed.
|
List<SyndEntry> |
getEntries()
Returns the feed entries.
|
String |
getFeedType()
Returns the wire feed type the feed had/will-have when coverted from/to a WireFeed.
|
List<org.jdom2.Element> |
getForeignMarkup()
Returns foreign markup found at channel level.
|
String |
getGenerator()
A string indicating the program used to generate the channel.
|
SyndImage |
getImage()
Returns the feed image.
|
Class<SyndFeed> |
getInterface()
Returns the interface the copyFrom works on.
|
String |
getLanguage()
Returns the feed language.
|
String |
getLink()
Returns the feed link.
|
List<SyndLink> |
getLinks()
Returns the links
|
String |
getManagingEditor()
The email address of the managing editor of the site, the person to contact for editorial
inquiries.
|
Module |
getModule(String uri)
Returns the module identified by a given URI.
|
List<Module> |
getModules()
Returns the feed modules.
|
Date |
getPublishedDate()
Returns the feed published date.
|
String |
getStyleSheet()
URL of XSL-Stylesheet.
|
List<String> |
getSupportedFeedTypes()
Returns the real feed types the SyndFeedImpl supports when converting from and to.
|
String |
getTitle()
Returns the feed title.
|
SyndContent |
getTitleEx()
Returns the feed title as a text construct.
|
String |
getUri()
Returns the feed URI.
|
String |
getWebMaster()
The email address of the webmaster for the site, the person to contact if there are technical
problems with the channel.
|
int |
hashCode()
Returns a hashcode value for the object.
|
boolean |
isPreservingWireFeed() |
WireFeed |
originalWireFeed()
Returns the WireFeed this SyndFeed was created from.
|
void |
setAuthor(String author)
Sets the feed author.
|
void |
setAuthors(List<SyndPerson> authors)
Sets the feed authors.
|
void |
setCategories(List<SyndCategory> categories)
Sets the feed categories.
|
void |
setContributors(List<SyndPerson> contributors)
Sets the feed author.
|
void |
setCopyright(String copyright)
Sets the feed copyright.
|
void |
setDescription(String description)
Sets the feed description.
|
void |
setDescriptionEx(SyndContent description)
Sets the feed description as a text construct.
|
void |
setDocs(String docs)
This tag should contain a URL that references a description of the channel.
|
void |
setEncoding(String encoding)
Sets the charset encoding of a the feed.
|
void |
setEntries(List<SyndEntry> entries)
Sets the feed entries.
|
void |
setFeedType(String feedType)
Sets the wire feed type the feed will-have when coverted to a WireFeed.
|
void |
setForeignMarkup(List<org.jdom2.Element> foreignMarkup)
Sets foreign markup found at channel level.
|
void |
setGenerator(String generator)
A string indicating the program used to generate the channel.
|
void |
setImage(SyndImage image)
Sets the feed image.
|
void |
setLanguage(String language)
Sets the feed language.
|
void |
setLink(String link)
Sets the feed link.
|
void |
setLinks(List<SyndLink> links)
Set the links
|
void |
setManagingEditor(String managingEditor)
The email address of the managing editor of the site, the person to contact for editorial
inquiries.
|
void |
setModules(List<Module> modules)
Sets the feed modules.
|
void |
setPublishedDate(Date publishedDate)
Sets the feed published date.
|
void |
setStyleSheet(String styleSheet)
URL of XSL-Stylesheet.
|
void |
setTitle(String title)
Sets the feed title.
|
void |
setTitleEx(SyndContent title)
Sets the feed title as a text construct.
|
void |
setUri(String uri)
Sets the feed URI.
|
void |
setWebMaster(String webMaster)
The email address of the webmaster for the site, the person to contact if there are technical
problems with the channel.
|
String |
toString()
Returns the String representation for the object.
|
public static final Set<String> CONVENIENCE_PROPERTIES
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.
protected SyndFeedImpl(Class<?> beanClass, Set<String> convenienceProperties)
beanClass
- convenienceProperties
- set containing the convenience properties of the SyndEntryImpl
(the are ignored during cloning, check CloneableBean for details).public SyndFeedImpl()
public SyndFeedImpl(WireFeed feed)
feed
- the RSS Channel or the Atom Feed to populate the properties from.public SyndFeedImpl(WireFeed feed, boolean preserveWireFeed)
feed
- preserveWireFeed
- public List<String> getSupportedFeedTypes()
getSupportedFeedTypes
in interface SyndFeed
public Object clone() throws CloneNotSupportedException
clone
in interface SyndFeed
clone
in class Object
CloneNotSupportedException
- thrown if an element of the object cannot be cloned.public boolean equals(Object other)
public int hashCode()
It follows the contract defined by the Object hashCode() method.
public String toString()
public WireFeed createWireFeed()
The feed type of the created WireFeed is taken from the SyndFeedImpl feedType property.
createWireFeed
in interface SyndFeed
public WireFeed createWireFeed(String feedType)
createWireFeed
in interface SyndFeed
feedType
- the feed type for the WireFeed to be created.public WireFeed originalWireFeed()
originalWireFeed
in interface SyndFeed
public String getFeedType()
getFeedType
in interface SyndFeed
public void setFeedType(String feedType)
setFeedType
in interface SyndFeed
feedType
- the feed type to set, null if none.public String getEncoding()
getEncoding
in interface SyndFeed
public void setEncoding(String encoding)
setEncoding
in interface SyndFeed
encoding
- the charset encoding of the feed.public String getUri()
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.
public void setUri(String 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.
public String getTitle()
public void setTitle(String title)
public SyndContent getTitleEx()
getTitleEx
in interface SyndFeed
public void setTitleEx(SyndContent title)
setTitleEx
in interface SyndFeed
title
- the feed title to set, null if none.public String getLink()
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.
public void setLink(String 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.
public String getDescription()
getDescription
in interface SyndFeed
public void setDescription(String description)
setDescription
in interface SyndFeed
description
- the feed description to set, null if none.public SyndContent getDescriptionEx()
getDescriptionEx
in interface SyndFeed
public void setDescriptionEx(SyndContent description)
setDescriptionEx
in interface SyndFeed
description
- the feed description to set, null if none.public Date getPublishedDate()
This method is a convenience method, it maps to the Dublin Core module date.
getPublishedDate
in interface SyndFeed
public void setPublishedDate(Date publishedDate)
This method is a convenience method, it maps to the Dublin Core module date.
setPublishedDate
in interface SyndFeed
publishedDate
- the feed published date to set, null if none.public String getCopyright()
This method is a convenience method, it maps to the Dublin Core module rights.
getCopyright
in interface SyndFeed
public void setCopyright(String copyright)
This method is a convenience method, it maps to the Dublin Core module rights.
setCopyright
in interface SyndFeed
copyright
- the feed copyright to set, null if none.public SyndImage getImage()
public void setImage(SyndImage image)
public List<SyndCategory> getCategories()
This method is a convenience method, it maps to the Dublin Core module subjects.
getCategories
in interface SyndFeed
public void setCategories(List<SyndCategory> categories)
This method is a convenience method, it maps to the Dublin Core module subjects.
setCategories
in interface SyndFeed
categories
- the list of SyndCategoryImpl elements with the feed categories to set, an
empty list or null if none.public List<SyndEntry> getEntries()
getEntries
in interface SyndFeed
public void setEntries(List<SyndEntry> entries)
setEntries
in interface SyndFeed
entries
- the list of SyndEntryImpl elements with the feed entries to set, an empty list
or null if none.public String getLanguage()
This method is a convenience method, it maps to the Dublin Core module language.
getLanguage
in interface SyndFeed
public void setLanguage(String language)
This method is a convenience method, it maps to the Dublin Core module language.
setLanguage
in interface SyndFeed
language
- the feed language to set, null if none.public List<Module> getModules()
getModules
in interface Extendable
getModules
in interface SyndFeed
public void setModules(List<Module> modules)
setModules
in interface Extendable
setModules
in interface SyndFeed
modules
- the list of ModuleImpl elements with the feed modules to set, an empty list or
null if none.public Module getModule(String uri)
getModule
in interface Extendable
getModule
in interface SyndFeed
uri
- the URI of the ModuleImpl.public Class<SyndFeed> getInterface()
CopyFrom
This is useful when dealing with properties that may have multiple implementations. For example, Module.
getInterface
in interface CopyFrom
public void copyFrom(CopyFrom obj)
CopyFrom
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.
public List<SyndPerson> getAuthors()
SyndFeed
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.
getAuthors
in interface SyndFeed
public void setAuthors(List<SyndPerson> authors)
SyndFeed
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.
setAuthors
in interface SyndFeed
authors
- the feed authors to set, null if none.public String getAuthor()
This method is a convenience method, it maps to the Dublin Core module creator.
public void setAuthor(String author)
This method is a convenience method, it maps to the Dublin Core module creator.
public List<SyndPerson> getContributors()
SyndFeed
For Atom feeds, this returns the contributors as a list of SyndPerson objects
getContributors
in interface SyndFeed
public void setContributors(List<SyndPerson> contributors)
SyndFeed
Returns contributors as a list of SyndPerson objects.
setContributors
in interface SyndFeed
contributors
- the feed contributors to set, null if none.public List<org.jdom2.Element> getForeignMarkup()
getForeignMarkup
in interface SyndFeed
public void setForeignMarkup(List<org.jdom2.Element> foreignMarkup)
setForeignMarkup
in interface SyndFeed
foreignMarkup
- Opaque object to discourage usepublic boolean isPreservingWireFeed()
isPreservingWireFeed
in interface SyndFeed
public String getDocs()
SyndFeed
public void setDocs(String docs)
SyndFeed
public String getGenerator()
SyndFeed
getGenerator
in interface SyndFeed
null
public void setGenerator(String generator)
SyndFeed
setGenerator
in interface SyndFeed
public String getManagingEditor()
SyndFeed
getManagingEditor
in interface SyndFeed
null
public void setManagingEditor(String managingEditor)
SyndFeed
setManagingEditor
in interface SyndFeed
managingEditor
- email address of the managing editorpublic String getWebMaster()
SyndFeed
getWebMaster
in interface SyndFeed
null
public void setWebMaster(String webMaster)
SyndFeed
setWebMaster
in interface SyndFeed
webMaster
- email address of the webmasterpublic String getStyleSheet()
SyndFeed
getStyleSheet
in interface SyndFeed
null
public void setStyleSheet(String styleSheet)
SyndFeed
setStyleSheet
in interface SyndFeed
styleSheet
- URL or null
Copyright © 2017. All rights reserved.