Class SyndEntryImpl
- java.lang.Object
-
- com.rometools.rome.feed.synd.SyndEntryImpl
-
- All Implemented Interfaces:
CopyFrom,Extendable,SyndEntry,Serializable,Cloneable
public class SyndEntryImpl extends Object implements Serializable, SyndEntry
Bean for entries of SyndFeedImpl feeds.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>CONVENIENCE_PROPERTIESUnmodifiable Set containing the convenience properties of this class.
-
Constructor Summary
Constructors Modifier Constructor Description SyndEntryImpl()protectedSyndEntryImpl(Class<?> beanClass, Set<String> convenienceProperties)For implementations extending SyndEntryImpl to be able to use the ObjectBean functionality with extended interfaces.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Creates a deep 'bean' clone of the object.voidcopyFrom(CopyFrom obj)Copies all the properties of the given bean into this one.booleanequals(Object other)Indicates whether some other object is "equal to" this one as defined by the Object equals() method.SyndLinkfindRelatedLink(String relation)Returns the first instance of a SyndLink with the specified relation, or nullStringgetAuthor()Returns the name of the first entry author in the collection of authors.List<SyndPerson>getAuthors()Returns the entry authors.List<SyndCategory>getCategories()Returns the entry categories.StringgetComments()URL of a page for comments relating to the item.List<SyndContent>getContents()Returns the entry contents.List<SyndPerson>getContributors()Returns the feed author.SyndContentgetDescription()Returns the entry description.List<SyndEnclosure>getEnclosures()Returns the entry enclosures.List<org.jdom2.Element>getForeignMarkup()Returns foreign markup found at channel level.Class<SyndEntry>getInterface()Returns the interface the copyFrom works on.StringgetLink()Returns the entry link.List<SyndLink>getLinks()Returns the linksModulegetModule(String uri)Returns the module identified by a given URI.List<Module>getModules()Returns the entry modules.DategetPublishedDate()Returns the entry published date.SyndFeedgetSource()Returns the entry source.StringgetTitle()Returns the entry title.SyndContentgetTitleEx()Returns the entry title as a text construct.DategetUpdatedDate()Returns the updatedDateStringgetUri()Returns the entry URI.ObjectgetWireEntry()Return the original item this SyndEntry is generated from.inthashCode()Returns a hashcode value for the object.voidsetAuthor(String author)Sets the entry author.voidsetAuthors(List<SyndPerson> authors)Sets the entry authors.voidsetCategories(List<SyndCategory> categories)Sets the entry categories.voidsetComments(String comments)URL of a page for comments relating to the item.voidsetContents(List<SyndContent> contents)Sets the entry contents.voidsetContributors(List<SyndPerson> contributors)Sets the feed contributors.voidsetDescription(SyndContent description)Sets the entry description.voidsetEnclosures(List<SyndEnclosure> enclosures)Sets the entry enclosures.voidsetForeignMarkup(List<org.jdom2.Element> foreignMarkup)Sets foreign markup found at channel level.voidsetLink(String link)Sets the entry link.voidsetLinks(List<SyndLink> links)Set the linksvoidsetModules(List<Module> modules)Sets the entry modules.voidsetPublishedDate(Date publishedDate)Sets the entry published date.voidsetSource(SyndFeed source)Sets the entry source feed (for use if different from containing feed)voidsetTitle(String title)Sets the entry title.voidsetTitleEx(SyndContent title)Sets the entry title as a text construct.voidsetUpdatedDate(Date updatedDate)Set the updatedDatevoidsetUri(String uri)Sets the entry URI.voidsetWireEntry(Object wireEntry)StringtoString()Returns the String representation for the object.
-
-
-
Field Detail
-
CONVENIENCE_PROPERTIES
public static final Set<String> 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
-
SyndEntryImpl
protected SyndEntryImpl(Class<?> beanClass, Set<String> convenienceProperties)
For implementations extending SyndEntryImpl 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).
-
SyndEntryImpl
public SyndEntryImpl()
-
-
Method Detail
-
clone
public Object clone() throws CloneNotSupportedException
Creates a deep 'bean' clone of the object.- Specified by:
clonein interfaceSyndEntry- Overrides:
clonein classObject- Returns:
- a clone of the object.
- Throws:
CloneNotSupportedException- thrown if an element of the object cannot be cloned.
-
equals
public boolean equals(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 String toString()
Returns the String representation for the object.
-
getUri
public String getUri()
Returns the entry URI.How the entry 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.
-
setUri
public void setUri(String uri)
Sets the entry URI.How the entry 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.
-
getTitle
public String getTitle()
Returns the entry title.
-
setTitle
public void setTitle(String title)
Sets the entry title.
-
getTitleEx
public SyndContent getTitleEx()
Returns the entry title as a text construct.- Specified by:
getTitleExin interfaceSyndEntry- Returns:
- the entry title, null if none.
-
setTitleEx
public void setTitleEx(SyndContent title)
Sets the entry title as a text construct.- Specified by:
setTitleExin interfaceSyndEntry- Parameters:
title- the entry title to set, null if none.
-
getLink
public String getLink()
Returns the entry link.
-
setLink
public void setLink(String link)
Sets the entry link.
-
getDescription
public SyndContent getDescription()
Returns the entry description.- Specified by:
getDescriptionin interfaceSyndEntry- Returns:
- the entry description, null if none.
-
setDescription
public void setDescription(SyndContent description)
Sets the entry description.- Specified by:
setDescriptionin interfaceSyndEntry- Parameters:
description- the entry description to set, null if none.
-
getContents
public List<SyndContent> getContents()
Returns the entry contents.- Specified by:
getContentsin interfaceSyndEntry- Returns:
- a list of SyndContentImpl elements with the entry contents, an empty list if none.
-
setContents
public void setContents(List<SyndContent> contents)
Sets the entry contents.- Specified by:
setContentsin interfaceSyndEntry- Parameters:
contents- the list of SyndContentImpl elements with the entry contents to set, an empty list or null if none.
-
getEnclosures
public List<SyndEnclosure> getEnclosures()
Returns the entry enclosures.- Specified by:
getEnclosuresin interfaceSyndEntry- Returns:
- a list of SyndEnclosure elements with the entry enclosures, an empty list if none.
-
setEnclosures
public void setEnclosures(List<SyndEnclosure> enclosures)
Sets the entry enclosures.- Specified by:
setEnclosuresin interfaceSyndEntry- Parameters:
enclosures- the list of SyndEnclosure elements with the entry enclosures to set, an empty list or null if none.
-
getPublishedDate
public Date getPublishedDate()
Returns the entry published date.This method is a convenience method, it maps to the Dublin Core module date.
- Specified by:
getPublishedDatein interfaceSyndEntry- Returns:
- the entry published date, null if none.
-
setPublishedDate
public void setPublishedDate(Date publishedDate)
Sets the entry published date.This method is a convenience method, it maps to the Dublin Core module date.
- Specified by:
setPublishedDatein interfaceSyndEntry- Parameters:
publishedDate- the entry published date to set, null if none.
-
getCategories
public List<SyndCategory> getCategories()
Returns the entry categories.- Specified by:
getCategoriesin interfaceSyndEntry- Returns:
- a list of SyndCategoryImpl elements with the entry categories, an empty list if none.
-
setCategories
public void setCategories(List<SyndCategory> categories)
Sets the entry categories.This method is a convenience method, it maps to the Dublin Core module subjects.
- Specified by:
setCategoriesin interfaceSyndEntry- Parameters:
categories- the list of SyndCategoryImpl elements with the entry categories to set, an empty list or null if none.
-
getModules
public List<Module> getModules()
Returns the entry modules.- Specified by:
getModulesin interfaceExtendable- Specified by:
getModulesin interfaceSyndEntry- Returns:
- a list of ModuleImpl elements with the entry modules, an empty list if none.
-
setModules
public void setModules(List<Module> modules)
Sets the entry modules.- Specified by:
setModulesin interfaceExtendable- Specified by:
setModulesin interfaceSyndEntry- Parameters:
modules- the list of ModuleImpl elements with the entry modules to set, an empty list or null if none.
-
getModule
public Module getModule(String uri)
Returns the module identified by a given URI.- Specified by:
getModulein interfaceExtendable- Specified by:
getModulein interfaceSyndEntry- Parameters:
uri- the URI of the ModuleImpl.- Returns:
- The module with the given URI, null if none.
-
getInterface
public Class<SyndEntry> getInterface()
Description copied from interface:CopyFromReturns the interface the copyFrom works on.This is useful when dealing with properties that may have multiple implementations. For example, Module.
- Specified by:
getInterfacein interfaceCopyFrom- Returns:
- the interface the copyFrom works on.
-
copyFrom
public void copyFrom(CopyFrom obj)
Description copied from interface:CopyFromCopies 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.
-
getUpdatedDate
public Date getUpdatedDate()
Returns the updatedDate- Specified by:
getUpdatedDatein interfaceSyndEntry- Returns:
- Returns the updatedDate.
-
setUpdatedDate
public void setUpdatedDate(Date updatedDate)
Set the updatedDate- Specified by:
setUpdatedDatein interfaceSyndEntry- Parameters:
updatedDate- The updatedDate to set.
-
getAuthors
public List<SyndPerson> getAuthors()
Description copied from interface:SyndEntryReturns the entry authors.For Atom feeds, this returns the authors as a list of SyndPerson objects.
- Specified by:
getAuthorsin interfaceSyndEntry- Returns:
- the feed authors, empty list if none.
-
setAuthors
public void setAuthors(List<SyndPerson> authors)
Description copied from interface:SyndEntrySets the entry authors.For Atom feeds, this sets the authors as a list of SyndPerson objects.
- Specified by:
setAuthorsin interfaceSyndEntry- Parameters:
authors- the feed authors to set, null if none.
-
getAuthor
public String getAuthor()
Description copied from interface:SyndEntryReturns the name of the first entry author in the collection of 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.
-
setAuthor
public void setAuthor(String author)
Sets the entry author.This method is a convenience method, it maps to the Dublin Core module creator.
-
getContributors
public List<SyndPerson> getContributors()
Description copied from interface:SyndEntryReturns the feed author.For Atom feeds, this returns the contributors as a list of SyndPerson objects
- Specified by:
getContributorsin interfaceSyndEntry- Returns:
- the feed author, null if none.
-
setContributors
public void setContributors(List<SyndPerson> contributors)
Description copied from interface:SyndEntrySets the feed contributors.Returns contributors as a list of SyndPerson objects.
- Specified by:
setContributorsin interfaceSyndEntry- Parameters:
contributors- the feed contributors to set, null if none.
-
getSource
public SyndFeed getSource()
Description copied from interface:SyndEntryReturns the entry source.This returns the entry source as a SyndFeed
-
setSource
public void setSource(SyndFeed source)
Description copied from interface:SyndEntrySets the entry source feed (for use if different from containing feed)
-
getForeignMarkup
public List<org.jdom2.Element> getForeignMarkup()
Returns foreign markup found at channel level.- Specified by:
getForeignMarkupin interfaceSyndEntry- Returns:
- list of JDOM nodes containing channel-level foreign markup, an empty list if none.
-
setForeignMarkup
public void setForeignMarkup(List<org.jdom2.Element> foreignMarkup)
Sets foreign markup found at channel level.- Specified by:
setForeignMarkupin interfaceSyndEntry- Parameters:
foreignMarkup- list of JDOM nodes containing channel-level foreign markup, an empty list if none.
-
getComments
public String getComments()
Description copied from interface:SyndEntryURL of a page for comments relating to the item.- Specified by:
getCommentsin interfaceSyndEntry- Returns:
- comments URL or
null.
-
setComments
public void setComments(String comments)
Description copied from interface:SyndEntryURL of a page for comments relating to the item.- Specified by:
setCommentsin interfaceSyndEntry- Parameters:
comments- URL
-
getWireEntry
public Object getWireEntry()
Description copied from interface:SyndEntryReturn the original item this SyndEntry is generated from. The type of the object returned depends on the original type of the feed. Atom 0.3/1.0 will return com.rometools.rome.feed.atom.Entry, while RSS will return com.rometools.rome.feed.rss.Item.java. If this entry was not generated from a WireFeed, or the SyndFeed was not set to preserve the WireFeed then it will return null- Specified by:
getWireEntryin interfaceSyndEntry- Returns:
- the WireFeed Item or Entry this Entry is generated from, or null
-
setWireEntry
public void setWireEntry(Object wireEntry)
-
findRelatedLink
public SyndLink findRelatedLink(String relation)
Description copied from interface:SyndEntryReturns the first instance of a SyndLink with the specified relation, or null- Specified by:
findRelatedLinkin interfaceSyndEntry
-
-