|
||||||||||
| 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.RSSItem
public abstract class RSSItem
This abstract class defines a simplified view of an RSS item, providing
only the methods necessary for curn to work. curn uses the
RSSParserFactory class to get a specific implementation of
RSSParser, which returns RSSChannel-conforming objects
that, in turn, return item objects that subclass RSSItem. 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. RSSItem. 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,
RSSChannel| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_CONTENT_TYPE
Constant defining the pseudo-MIME type to use for default content. |
static int |
NO_SUMMARY_LIMIT
Unlimited summary size |
| Constructor Summary | |
|---|---|
protected |
RSSItem()
Default constructor |
| Method Summary | |
|---|---|
abstract void |
addAuthor(java.lang.String author)
Add to the item's author list. |
abstract void |
clearAuthors()
Clear the authors list. |
void |
clearContent()
Clear the stored content for all MIME types, without clearing any other fields. |
java.lang.Object |
clone()
Clone this channel. |
int |
compareTo(java.lang.Object other)
Compare two items for order. |
boolean |
equals(java.lang.Object o)
Compare this item to some other object for equality. |
abstract java.util.Collection<java.lang.String> |
getAuthors()
Get the item's author list. |
abstract java.util.Collection<java.lang.String> |
getCategories()
Get the categories the item belongs to. |
java.lang.String |
getContent(java.lang.String mimeType)
Get the item's content, if available. |
java.lang.String |
getFirstContentOfType(java.lang.String... mimeTypes)
Get the first content item that matches one of a list of MIME types. |
abstract java.lang.String |
getID()
Get the item's ID field, if any. |
abstract java.util.Collection<RSSLink> |
getLinks()
Get the item's published links. |
abstract RSSChannel |
getParentChannel()
Get the parent channel |
abstract java.util.Date |
getPublicationDate()
Get the item's publication date. |
abstract java.lang.String |
getSummary()
Get the item's summary (also sometimes called the description or synopsis). |
abstract java.lang.String |
getTitle()
Get the item's title |
int |
hashCode()
Generate a hash code for this item. |
RSSItem |
makeCopy(RSSChannel parentChannel)
Make a deep copy of this RSSItem object. |
abstract RSSItem |
newInstance(RSSChannel channel)
Create a new, empty instance of the underlying concrete class. |
abstract void |
setCategories(java.util.Collection<java.lang.String> categories)
Set the categories the item belongs to. |
void |
setContent(java.lang.String content,
java.lang.String mimeType)
Set the content for a specific MIME type. |
abstract void |
setID(java.lang.String id)
Set the item's ID field, if any. |
abstract void |
setLinks(java.util.Collection<RSSLink> links)
Set the item's published links. |
abstract void |
setPublicationDate(java.util.Date date)
Set the item's publication date. |
abstract void |
setSummary(java.lang.String newSummary)
Set the item's summary (also sometimes called the description or synopsis). |
abstract void |
setTitle(java.lang.String newTitle)
Set the item's title |
java.lang.String |
toString()
Return the string value of the item (which, right now, is its title). |
| Methods inherited from class org.clapper.curn.parser.RSSElement |
|---|
getAuthor, getLink, getLink, getLink, getLinkWithFallback, getURL, setAuthor, setAuthors |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_CONTENT_TYPE
public static final int NO_SUMMARY_LIMIT
| Constructor Detail |
|---|
protected RSSItem()
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
makeCopy(org.clapper.curn.parser.RSSChannel) 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(org.clapper.curn.parser.RSSChannel)public RSSItem makeCopy(RSSChannel parentChannel)
parentChannel - the parent channel to assign to the new instance
public java.lang.String getContent(java.lang.String mimeType)
mimeType - the desired MIME type
clearContent(),
getFirstContentOfType(java.lang.String...),
setContent(java.lang.String, java.lang.String)public final java.lang.String getFirstContentOfType(java.lang.String... mimeTypes)
mimeTypes - an array of MIME types to match, in order
getContent(java.lang.String),
clearContent(),
setContent(java.lang.String, java.lang.String)
public void setContent(java.lang.String content,
java.lang.String mimeType)
content - the content stringmimeType - the MIME type to associate with the contentgetContent(java.lang.String),
getFirstContentOfType(java.lang.String...),
clearContent()public void clearContent()
getContent(java.lang.String),
getFirstContentOfType(java.lang.String...),
setContent(java.lang.String, java.lang.String)public int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - the other object
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract RSSItem newInstance(RSSChannel channel)
channel - the parent channel
public abstract RSSChannel getParentChannel()
public abstract java.lang.String getTitle()
setTitle(java.lang.String)public abstract void setTitle(java.lang.String newTitle)
newTitle - the item's title, or null if there isn't onegetTitle()public abstract java.lang.String getSummary()
setSummary(java.lang.String)public abstract void setSummary(java.lang.String newSummary)
newSummary - the summary, or null if not availablegetSummary()public abstract java.util.Collection<java.lang.String> getAuthors()
getAuthors in class RSSElementaddAuthor(java.lang.String),
clearAuthors(),
RSSElement.setAuthors(java.util.Collection) public abstract void addAuthor(java.lang.String author)
addAuthor in class RSSElementauthor - another author string to addgetAuthors(),
clearAuthors(),
RSSElement.setAuthors(java.util.Collection) public abstract void clearAuthors()
clearAuthors in class RSSElementgetAuthors(),
addAuthor(java.lang.String),
RSSElement.setAuthors(java.util.Collection) public abstract java.util.Collection<RSSLink> getLinks()
getLinks in class RSSElementsetLinks(java.util.Collection) public abstract void setLinks(java.util.Collection<RSSLink> links)
links - the collection of links, or an empty collection (or null)getLinks()public abstract java.util.Collection<java.lang.String> getCategories()
setCategories(java.util.Collection) public abstract void setCategories(java.util.Collection<java.lang.String> categories)
categories - a Collection of category strings
or null if not applicablegetCategories()public abstract java.util.Date getPublicationDate()
getPublicationDate()public abstract void setPublicationDate(java.util.Date date)
getPublicationDate()public abstract java.lang.String getID()
setID(java.lang.String)public abstract void setID(java.lang.String id)
id - the ID field, or null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||