| java.lang.Object org.clapper.curn.parser.RSSElement org.clapper.curn.parser.RSSItem
All known Subclasses: org.clapper.curn.parser.rome.RSSItemAdapter,
RSSItem | abstract public class RSSItem extends RSSElement implements Cloneable,Comparable(Code) | | 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.
See Also: RSSParserFactory See Also: RSSParser See Also: RSSChannel version: $Revision: 7041 $ |
Constructor Summary | |
protected | RSSItem() |
DEFAULT_CONTENT_TYPE | final public static String DEFAULT_CONTENT_TYPE(Code) | | Constant defining the pseudo-MIME type to use for default content.
|
NO_SUMMARY_LIMIT | final public static int NO_SUMMARY_LIMIT(Code) | | Unlimited summary size
|
RSSItem | protected RSSItem()(Code) | | Default constructor
|
compareTo | public int compareTo(Object other)(Code) | | Compare two items for order. The channels are ordered first by
publication date (if any), then by title, then by unique ID,
then by hash code (if all else is equal).
Parameters: other - the other object negative number: this item is less than other; 0: this item is equivalent to other positive unmber: this item is greater than other |
copyPrivateFields | abstract protected void copyPrivateFields(RSSItem toItem)(Code) | | Used by
RSSItem.makeCopy , this method copies any subclass fields
that aren't visible to this class.
Parameters: toItem - the other RSSItem into which to copy fields.item will have been created by a call toRSSItem.newInstance |
equals | public boolean equals(Object o)(Code) | | Compare this item to some other object for equality.
Parameters: o - the object true if the objects are equal, false if not |
getCategories | abstract public Collection<String> getCategories()(Code) | | Get the categories the item belongs to.
a Collection of category strings (Stringobjects) or null if not applicable See Also: RSSItem.setCategories |
getContent | public String getContent(String mimeType)(Code) | | Get the item's content, if available. Some feed types (e.g., Atom)
support multiple content sections, each with its own MIME type; the
mimeType parameter specifies the caller's desired MIME
type.
Parameters: mimeType - the desired MIME type the content (or the default content), or null if no contentof the desired MIME type is available See Also: RSSItem.clearContent See Also: RSSItem.getFirstContentOfType See Also: RSSItem.setContent |
getFirstContentOfType | final public String getFirstContentOfType(String... mimeTypes)(Code) | | Get the first content item that matches one of a list of MIME types.
Parameters: mimeTypes - an array of MIME types to match, in order the first matching content string, or null if none was found.Returns the default content (if set), if there's no exactmatch. See Also: RSSItem.getContent See Also: RSSItem.clearContent See Also: RSSItem.setContent |
getID | abstract public String getID()(Code) | | Get the item's ID field, if any.
the ID field, or null if not set See Also: RSSItem.setID |
getParentChannel | abstract public RSSChannel getParentChannel()(Code) | | Get the parent channel
the parent channel |
getSummary | abstract public String getSummary()(Code) | | Get the item's summary (also sometimes called the description or
synopsis).
the summary, or null if not available See Also: RSSItem.setSummary |
hashCode | public int hashCode()(Code) | | Generate a hash code for this item.
the hash code |
makeCopy | public RSSItem makeCopy(RSSChannel parentChannel)(Code) | | Make a deep copy of this RSSItem object.
Parameters: parentChannel - the parent channel to assign to the new instance the copy |
newInstance | abstract public RSSItem newInstance(RSSChannel channel)(Code) | | Create a new, empty instance of the underlying concrete
class.
Parameters: channel - the parent channel the new instance |
setCategories | abstract public void setCategories(Collection<String> categories)(Code) | | Set the categories the item belongs to.
Parameters: categories - a Collection of category stringsor null if not applicable See Also: RSSItem.getCategories |
setContent | public void setContent(String content, String mimeType)(Code) | | Set the content for a specific MIME type. If the
isDefault flag is true, then this content
is served up as the default whenever content for a specific MIME type
is requested but isn't available.
Parameters: content - the content string Parameters: mimeType - the MIME type to associate with the content See Also: RSSItem.getContent See Also: RSSItem.getFirstContentOfType See Also: RSSItem.clearContent |
setID | abstract public void setID(String id)(Code) | | Set the item's ID field, if any.
Parameters: id - the ID field, or null |
setLinks | abstract public void setLinks(Collection<RSSLink> links)(Code) | | Set the item's published links.
Parameters: links - the collection of links, or an empty collection (or null) See Also: RSSItem.getLinks |
setPublicationDate | abstract public void setPublicationDate(Date date)(Code) | | Set the item's publication date.
Parameters: date - the new date, or null to clear See Also: RSSItem.getPublicationDate |
setSummary | abstract public void setSummary(String newSummary)(Code) | | Set the item's summary (also sometimes called the description or
synopsis).
Parameters: newSummary - the summary, or null if not available See Also: RSSItem.getSummary |
setTitle | abstract public void setTitle(String newTitle)(Code) | | Set the item's title
Parameters: newTitle - the item's title, or null if there isn't one See Also: RSSItem.getTitle |
toString | public String toString()(Code) | | Return the string value of the item (which, right now, is its
title).
the title |
|
|