|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.curn.parser.RSSElement
org.clapper.curn.parser.RSSChannel
public abstract class RSSChannel
This abstract class defines a simplified view of an RSS channel,
providing only the methods necessary for curn to work.
curn uses the RSSParserFactory class to get a specific
implementation of RSSParser, which returns an object that is a
subclass of this class. This strategy isolates the bulk of the code from
the underlying RSS parser, making it easier to substitute different
parsers as more of them become available.
RSSParserFactory,
RSSParser,
RSSItem| Constructor Summary | |
|---|---|
protected |
RSSChannel()
Default constructor. |
| Method Summary | |
|---|---|
abstract void |
addAuthor(java.lang.String author)
Add to the channel's author list. |
abstract void |
clearAuthors()
Clear the authors list. |
java.lang.Object |
clone()
Clone this channel. |
abstract java.util.Collection<java.lang.String> |
getAuthors()
Get the channel's author list. |
abstract java.lang.String |
getCopyright()
Get the channel's copyright string |
abstract java.lang.String |
getDescription()
Get the channel's description |
abstract java.util.Collection<RSSItem> |
getItems()
Get a Collection of the items in this channel. |
abstract java.util.Collection<RSSLink> |
getLinks()
Get the channel's list of published links (its URLs). |
java.lang.Object |
getNativeRSSFormat()
Get the RSS format the channel is using, in native format. |
abstract java.util.Date |
getPublicationDate()
Get the channel's publication date. |
abstract java.lang.String |
getRSSFormat()
Get the RSS format the channel is using, as a string |
abstract java.lang.String |
getTitle()
Get the channel's title |
RSSChannel |
makeCopy()
Make a deep copy of this RSSChannel object. |
abstract RSSChannel |
newInstance()
Create a new, empty instance of the underlying concrete class. |
abstract boolean |
removeItem(RSSItem item)
Remove an item from the set of items. |
abstract void |
setCopyright(java.lang.String copyright)
Set the channel's copyright string |
abstract void |
setDescription(java.lang.String desc)
Set the channel's description |
abstract void |
setItems(java.util.Collection<? extends RSSItem> newItems)
Change the items the channel the ones in the specified collection. |
abstract void |
setLinks(java.util.Collection<RSSLink> links)
Set the channel's list of published links (its URLs). |
abstract void |
setNativeRSSFormat(java.lang.Object format)
Set the RSS format the channel is using. |
abstract void |
setPublicationDate(java.util.Date date)
Set the channel's publication date. |
abstract void |
setTitle(java.lang.String newTitle)
Set the channel's title |
void |
stripHTML()
Strip all HTML and weird plain text from the channel and its items. |
java.lang.String |
toString()
Return a string representation of this channel. |
| Methods inherited from class org.clapper.curn.parser.RSSElement |
|---|
getAuthor, getLink, getLink, getLink, getLinkWithFallback, getURL, setAuthor, setAuthors |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected RSSChannel()
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
makeCopy() method. The clone is a deep-clone (i.e., the items
are cloned, too).
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - doesn't, actually, but the
Cloneable interface
requires that this exception
be declaredmakeCopy()public RSSChannel makeCopy()
public void stripHTML()
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract RSSChannel newInstance()
public abstract java.util.Collection<RSSItem> getItems()
public abstract void setItems(java.util.Collection<? extends RSSItem> newItems)
newItems - new collection of RSSItem items.public abstract boolean removeItem(RSSItem item)
item - the item to remove
public abstract java.lang.String getTitle()
setTitle(String)public abstract void setTitle(java.lang.String newTitle)
newTitle - the channel's title, or null if there isn't onegetTitle()public abstract java.lang.String getDescription()
setDescription(java.lang.String)public abstract void setDescription(java.lang.String desc)
desc - the channel's description, or null if there isn't onegetDescription()public abstract java.util.Collection<RSSLink> getLinks()
RSSLink object.
getLinks in class RSSElementRSSElement.getLink(java.lang.String, org.clapper.curn.parser.RSSLink.Type...),
setLinks(java.util.Collection) public abstract void setLinks(java.util.Collection<RSSLink> links)
links - the linksRSSElement.getLink(java.lang.String, org.clapper.curn.parser.RSSLink.Type...),
getLinks()public abstract java.util.Date getPublicationDate()
setPublicationDate(java.util.Date)public abstract void setPublicationDate(java.util.Date date)
date - the publication date, or null if not availablegetPublicationDate()public abstract java.lang.String getCopyright()
setCopyright(java.lang.String)public abstract void setCopyright(java.lang.String copyright)
copyright - the copyright string, or null if not availablegetCopyright()public abstract java.lang.String getRSSFormat()
getNativeRSSFormat(),
setNativeRSSFormat(java.lang.Object)public java.lang.Object getNativeRSSFormat()
makeCopy() method to copy the RSS format without knowing
how it's stored. The default implementation of this method
simply calls getRSSFormat().
getRSSFormat(),
setNativeRSSFormat(java.lang.Object)public abstract void setNativeRSSFormat(java.lang.Object format)
format - the format, or null if not availablegetRSSFormat(),
getNativeRSSFormat()public abstract java.util.Collection<java.lang.String> getAuthors()
getAuthors in class RSSElementaddAuthor(java.lang.String),
clearAuthors(),
RSSElement.setAuthor(java.lang.String)public abstract void addAuthor(java.lang.String author)
addAuthor in class RSSElementauthor - another author string to addgetAuthors(),
clearAuthors(),
RSSElement.setAuthor(java.lang.String)public abstract void clearAuthors()
clearAuthors in class RSSElementgetAuthors(),
addAuthor(java.lang.String),
RSSElement.setAuthor(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||