org.clapper.curn.parser.informa
Class RSSChannelAdapter

java.lang.Object
  extended by org.clapper.curn.parser.RSSElement
      extended by org.clapper.curn.parser.RSSChannel
          extended by org.clapper.curn.parser.informa.RSSChannelAdapter
All Implemented Interfaces:
java.lang.Cloneable

public class RSSChannelAdapter
extends RSSChannel

This class implements the RSSChannel interface and defines an adapter for the Informa RSS Parser's ChannelIF type.

Version:
$Revision: 6305 $
See Also:
RSSParserFactory, RSSParser, RSSChannel, RSSItem, RSSItemAdapter

Method Summary
 void addAuthor(java.lang.String author)
          Add to the channel's author list.
 void clearAuthors()
          Clear the authors list.
 java.util.Collection<java.lang.String> getAuthors()
          Get the channel's author list.
 java.lang.String getCopyright()
          Get the channel's copyright string
 java.lang.String getDescription()
          Get the channel's description
 java.util.Collection<RSSItem> getItems()
          Get a Collection of the items in this channel.
 java.util.Collection<RSSLink> getLinks()
          Get the channel's published links.
 java.lang.Object getNativeRSSFormat()
          Get the RSS format the channel is using, in native format.
 java.util.Date getPublicationDate()
          Get the channel's publication date.
 java.lang.String getRSSFormat()
          Get the RSS format the channel is using.
 java.lang.String getTitle()
          Get the channel's title
 RSSChannel newInstance()
          Create a new, empty instance of the underlying concrete class.
 boolean removeItem(RSSItem item)
          Remove an item from the set of items.
 void setCopyright(java.lang.String copyright)
          Set the channel's copyright string
 void setDescription(java.lang.String desc)
          Set the channel's description
 void setItems(java.util.Collection<? extends RSSItem> newItems)
          Change the items the channel the ones in the specified collection.
 void setLinks(java.util.Collection<RSSLink> links)
          Set the channel's list of published links (its URLs).
 void setNativeRSSFormat(java.lang.Object format)
          Set the RSS format the channel is using.
 void setPublicationDate(java.util.Date date)
          Set the channel's publication date.
 void setTitle(java.lang.String newTitle)
          Set the channel's title
 
Methods inherited from class org.clapper.curn.parser.RSSChannel
clone, makeCopy, stripHTML, toString
 
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
 

Method Detail

newInstance

public RSSChannel newInstance()
Create a new, empty instance of the underlying concrete class.

Specified by:
newInstance in class RSSChannel
Returns:
the new instance

getItems

public java.util.Collection<RSSItem> getItems()
Get a Collection of the items in this channel. All objects in the collection are of type RSSItem.

Specified by:
getItems in class RSSChannel
Returns:
a (new) Collection of RSSItem objects. The collection will be empty (never null) if there are no items.

setItems

public void setItems(java.util.Collection<? extends RSSItem> newItems)
Change the items the channel the ones in the specified collection. If the collection is empty, the items are cleared. The items are copied from the supplied collection. (A reference to the supplied collection is not saved in this object.)

Specified by:
setItems in class RSSChannel
Parameters:
newItems - new collection of RSSItem items.

removeItem

public boolean removeItem(RSSItem item)
Remove an item from the set of items.

Specified by:
removeItem in class RSSChannel
Parameters:
item - the item to remove
Returns:
true if removed, false if not found

getTitle

public java.lang.String getTitle()
Get the channel's title

Specified by:
getTitle in class RSSChannel
Returns:
the channel's title, or null if there isn't one
See Also:
setTitle(String)

setTitle

public void setTitle(java.lang.String newTitle)
Set the channel's title

Specified by:
setTitle in class RSSChannel
Parameters:
newTitle - the channel's title, or null if there isn't one
See Also:
getTitle()

getDescription

public java.lang.String getDescription()
Get the channel's description

Specified by:
getDescription in class RSSChannel
Returns:
the channel's description, or null if there isn't one
See Also:
setDescription(java.lang.String)

setDescription

public void setDescription(java.lang.String desc)
Set the channel's description

Specified by:
setDescription in class RSSChannel
Parameters:
desc - the channel's description, or null if there isn't one
See Also:
getDescription()

getLinks

public final java.util.Collection<RSSLink> getLinks()
Get the channel's published links.

Specified by:
getLinks in class RSSChannel
Returns:
the collection of links, or an empty collection
See Also:
RSSElement.getLink(java.lang.String, org.clapper.curn.parser.RSSLink.Type...)

setLinks

public void setLinks(java.util.Collection<RSSLink> links)
Set the channel's list of published links (its URLs).

Specified by:
setLinks in class RSSChannel
Parameters:
links - the links
See Also:
RSSElement.getLink(java.lang.String, org.clapper.curn.parser.RSSLink.Type...), getLinks()

getPublicationDate

public java.util.Date getPublicationDate()
Get the channel's publication date.

Specified by:
getPublicationDate in class RSSChannel
Returns:
the date, or null if not available
See Also:
setPublicationDate(java.util.Date)

setPublicationDate

public void setPublicationDate(java.util.Date date)
Set the channel's publication date.

Specified by:
setPublicationDate in class RSSChannel
Parameters:
date - the publication date, or null if not available
See Also:
RSSChannel.getPublicationDate()

getCopyright

public java.lang.String getCopyright()
Get the channel's copyright string

Specified by:
getCopyright in class RSSChannel
Returns:
the copyright string, or null if not available
See Also:
setCopyright(java.lang.String)

setCopyright

public void setCopyright(java.lang.String copyright)
Set the channel's copyright string

Specified by:
setCopyright in class RSSChannel
Parameters:
copyright - the copyright string, or null if not available
See Also:
getCopyright()

getRSSFormat

public java.lang.String getRSSFormat()
Get the RSS format the channel is using.

Specified by:
getRSSFormat in class RSSChannel
Returns:
the format, or null if not available
See Also:
RSSChannel.getNativeRSSFormat(), RSSChannel.setNativeRSSFormat(java.lang.Object)

getNativeRSSFormat

public java.lang.Object getNativeRSSFormat()
Get the RSS format the channel is using, in native format. This method exists for underlying implementations that store the RSS format as something other than a string; the method allows the RSSChannel.makeCopy() method to copy the RSS format without knowing how it's stored. The default implementation of this method simply calls getRSSFormat().

Overrides:
getNativeRSSFormat in class RSSChannel
Returns:
the format, or null if not available
See Also:
getRSSFormat(), setNativeRSSFormat(java.lang.Object)

setNativeRSSFormat

public void setNativeRSSFormat(java.lang.Object format)
Set the RSS format the channel is using.

Specified by:
setNativeRSSFormat in class RSSChannel
Parameters:
format - the format, or null if not available
See Also:
getRSSFormat(), getNativeRSSFormat()

getAuthors

public java.util.Collection<java.lang.String> getAuthors()
Get the channel's author list.

Specified by:
getAuthors in class RSSChannel
Returns:
the authors, or null (or an empty Collection) if not available
See Also:
addAuthor(java.lang.String), clearAuthors()

addAuthor

public void addAuthor(java.lang.String author)
Add to the channel's author list.

Specified by:
addAuthor in class RSSChannel
Parameters:
author - another author string to add
See Also:
getAuthors(), clearAuthors()

clearAuthors

public void clearAuthors()
Clear the authors list.

Specified by:
clearAuthors in class RSSChannel
See Also:
getAuthors(), addAuthor(java.lang.String)


Copyright © 2004-2006 Brian M. Clapper. All Rights Reserved.