Lizzy v1.1.1

christophedelory.rss
Class Channel

java.lang.Object
  extended by christophedelory.rss.media.BaseMedia
      extended by christophedelory.rss.Channel

public class Channel
extends BaseMedia

Contains information about the channel (metadata) and its contents.

Version:
$Revision: 92 $
Author:
Christophe Delory

Constructor Summary
Channel()
           
 
Method Summary
 void addCategory(Category category)
          Specifies a category that the channel belongs to.
 void addItem(Item item)
          Adds an item to this channel.
 void addSkipDay(String skipDay)
          Adds a "day" sub-element which value is Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday.
 void addSkipHour(Integer skipHour)
          Adds an "hour" sub-element which value is a number between 0 and 23, representing a time in GMT.
 List<Category> getCategories()
          Returns a list of one or more categories that the channel belongs to.
 Cloud getCloud()
          Returns a RSS cloud descriptor.
 String getCopyright()
          Returns the copyright notice for content in the channel.
 String getDescription()
          Returns the phrase or sentence describing the channel.
 String getDocs()
          Returns an URL that points to the documentation for the format used in the RSS file.
 String getGenerator()
          Returns a string indicating the program used to generate the channel.
 Image getImage()
          Returns a GIF, JPEG or PNG image that can be displayed with the channel.
 List<Item> getItems()
          Returns the list of channel's items.
 String getLanguage()
          Returns the language the channel is written in.
 Date getLastBuildDate()
          Returns the last time the content of the channel changed.
 String getLastBuildDateString()
          Returns the last time the content of the channel changed.
 URI getLink()
          Returns the URL to the HTML website corresponding to the channel.
 String getLinkString()
          Returns the URL to the HTML website corresponding to the channel.
 String getManagingEditor()
          Returns the email address for person responsible for editorial content.
 Date getPubDate()
          Returns the publication date for the content in the channel.
 String getPubDateString()
          Returns the publication date for the content in the channel.
 String getRating()
          Returns the PICS rating for the channel.
 RSS getRSS()
          Returns the parent RSS document, if any.
 List<String> getSkipDays()
          Returns a hint for aggregators telling them which days they can skip.
 List<Integer> getSkipHours()
          Returns a hint for aggregators telling them which hours they can skip.
 TextInput getTextInput()
          Returns a text input box that can be displayed with the channel.
 String getTitle()
          Returns the name of the channel.
 Integer getTTL()
          Returns a number of minutes that indicates how long a channel can be cached before refreshing from the source.
 String getWebMaster()
          Returns the email address for person responsible for technical issues relating to channel.
 void setCloud(Cloud cloud)
          Initializes the RSS cloud descriptor.
 void setCopyright(String copyright)
          Initializes the copyright notice for content in the channel.
 void setDescription(String description)
          Initializes the phrase or sentence describing the channel.
 void setDocs(String docs)
          Initializes the URL that points to the documentation for the format used in the RSS file.
 void setGenerator(String generator)
          Initializes the string indicating the program used to generate the channel.
 void setImage(Image image)
          Initializes a GIF, JPEG or PNG image that can be displayed with the channel.
 void setLanguage(String language)
          Initializes the language the channel is written in.
 void setLastBuildDate(Date lastBuildDate)
          Initializes the last time the content of the channel changed.
 void setLastBuildDateString(String lastBuildDate)
          Initializes the last time the content of the channel changed.
 void setLink(URI link)
          Initializes the URL to the HTML website corresponding to the channel.
 void setLinkString(String link)
          Initializes the URL to the HTML website corresponding to the channel.
 void setManagingEditor(String managingEditor)
          Initializes the email address for person responsible for editorial content.
 void setPubDate(Date pubDate)
          Initializes the publication date for the content in the channel.
 void setPubDateString(String pubDate)
          Initializes the publication date for the content in the channel.
 void setRating(String rating)
          Initializes the PICS rating for the channel.
(package private)  void setRSS(RSS rss)
          Initializes the parent RSS document.
 void setTextInput(TextInput textInput)
          Initializes a text input box that can be displayed with the channel.
 void setTitle(String title)
          Initializes the name of the channel.
 void setTTL(Integer ttl)
          Initializes the number of minutes that indicates how long a channel can be cached before refreshing from the source.
 void setWebMaster(String webMaster)
          Initializes the email address for person responsible for technical issues relating to channel.
 
Methods inherited from class christophedelory.rss.media.BaseMedia
addMediaCategory, addMediaCredit, addMediaHash, addMediaRating, addMediaRestriction, addMediaText, addMediaThumbnail, getMediaAdult, getMediaCategories, getMediaCopyright, getMediaCredits, getMediaDescription, getMediaHashes, getMediaKeywords, getMediaPlayer, getMediaRatings, getMediaRestrictions, getMediaTexts, getMediaThumbnails, getMediaTitle, isMediaAdult, setMediaAdult, setMediaAdult, setMediaCopyright, setMediaDescription, setMediaKeywords, setMediaPlayer, setMediaTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Channel

public Channel()
Method Detail

getTitle

public String getTitle()
Returns the name of the channel. It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website. Example: "GoUpstate.com News Headlines". No default value.

Returns:
the channel's title. May be null if not yet initialized.
See Also:
setTitle(java.lang.String)

setTitle

public void setTitle(String title)
Initializes the name of the channel.

Parameters:
title - the channel's title. Shall not be null.
Throws:
NullPointerException - if title is null.
See Also:
getTitle()

setLinkString

public void setLinkString(String link)
                   throws URISyntaxException
Initializes the URL to the HTML website corresponding to the channel.

Parameters:
link - an URL as a string. Shall not be null.
Throws:
NullPointerException - if link is null.
URISyntaxException - if the given string violates RFC 2396, as augmented by the URI deviations.
See Also:
getLinkString(), setLink(java.net.URI)

getLinkString

public String getLinkString()
Returns the URL to the HTML website corresponding to the channel. Example: "http://www.goupstate.com/". No default value.

Returns:
an URL as a string. Shall not be null.
Throws:
NullPointerException - if no URL has been defined for this channel.
See Also:
setLinkString(java.lang.String), getLink()

setLink

public void setLink(URI link)
Initializes the URL to the HTML website corresponding to the channel.

Parameters:
link - an URL. Shall not be null.
Throws:
NullPointerException - if link is null.
See Also:
getLink(), setLinkString(java.lang.String)

getLink

public URI getLink()
Returns the URL to the HTML website corresponding to the channel.

Returns:
an URL. May be null if not yet initialized.
See Also:
setLink(java.net.URI), getLinkString()

getDescription

public String getDescription()
Returns the phrase or sentence describing the channel. Example: "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site". No default value.

Returns:
the channel's description. May be null if not yet initialized.
See Also:
setDescription(java.lang.String)

setDescription

public void setDescription(String description)
Initializes the phrase or sentence describing the channel.

Parameters:
description - the channel's description. Shall not be null.
Throws:
NullPointerException - if description is null.
See Also:
getDescription()

getLanguage

public String getLanguage()
Returns the language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C. In 0.91, the language element is required. In 0.92 it is optional. Why? If a channel is formed from various input sources there's no way to know that it's going to only contain a single language. Example: "en-us". No default value.

Returns:
a language. May be null.
See Also:
setLanguage(java.lang.String)

setLanguage

public void setLanguage(String language)
Initializes the language the channel is written in.

Parameters:
language - a language. May be null.
See Also:
getLanguage()

getCopyright

public String getCopyright()
Returns the copyright notice for content in the channel. Example: "Copyright 2002, Spartanburg Herald-Journal". No default value.

Returns:
a copyright notice. May be null.
See Also:
setCopyright(java.lang.String)

setCopyright

public void setCopyright(String copyright)
Initializes the copyright notice for content in the channel.

Parameters:
copyright - a copyright notice. May be null.
See Also:
getCopyright()

getManagingEditor

public String getManagingEditor()
Returns the email address for person responsible for editorial content. Example: "geo@herald.com (George Matesky)". No default value.

Returns:
the managing editor email. May be null.
See Also:
setManagingEditor(java.lang.String)

setManagingEditor

public void setManagingEditor(String managingEditor)
Initializes the email address for person responsible for editorial content.

Parameters:
managingEditor - the managing editor email. May be null.
See Also:
getManagingEditor()

getWebMaster

public String getWebMaster()
Returns the email address for person responsible for technical issues relating to channel. Example: "betty@herald.com (Betty Guernsey)". No default value.

Returns:
the Web master email. May be null.
See Also:
setWebMaster(java.lang.String)

setWebMaster

public void setWebMaster(String webMaster)
Initializes the email address for person responsible for technical issues relating to channel.

Parameters:
webMaster - the Web master email. May be null.
See Also:
getWebMaster()

setPubDateString

public void setPubDateString(String pubDate)
Initializes the publication date for the content in the channel.

Parameters:
pubDate - a date as a string. Shall not be null.
Throws:
NullPointerException - if pubDate is null.
See Also:
getPubDateString(), setPubDate(java.util.Date)

getPubDateString

public String getPubDateString()
Returns the publication date for the content in the channel.

Returns:
a date as a string. May be null.
See Also:
setPubDateString(java.lang.String), getPubDate()

setPubDate

public void setPubDate(Date pubDate)
Initializes the publication date for the content in the channel.

Parameters:
pubDate - a date. May be null.
See Also:
getPubDate(), setPubDateString(java.lang.String)

getPubDate

public Date getPubDate()
Returns the publication date for the content in the channel. For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes. All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred). Example: "Sat, 07 Sep 2002 00:00:01 GMT". No default value.

Returns:
a date. May be null.
See Also:
setPubDate(java.util.Date), getPubDateString()

setLastBuildDateString

public void setLastBuildDateString(String lastBuildDate)
Initializes the last time the content of the channel changed.

Parameters:
lastBuildDate - a date as a string. Shall not be null.
Throws:
NullPointerException - if lastBuildDate is null.
See Also:
getLastBuildDateString(), setLastBuildDate(java.util.Date)

getLastBuildDateString

public String getLastBuildDateString()
Returns the last time the content of the channel changed.

Returns:
a date as a string. May be null.
See Also:
setLastBuildDateString(java.lang.String), getLastBuildDate()

setLastBuildDate

public void setLastBuildDate(Date lastBuildDate)
Initializes the last time the content of the channel changed.

Parameters:
lastBuildDate - a date. May be null.
See Also:
getLastBuildDate(), setLastBuildDateString(java.lang.String)

getLastBuildDate

public Date getLastBuildDate()
Returns the last time the content of the channel changed. Example: "Sat, 07 Sep 2002 09:42:31 GMT". No default value.

Returns:
a date. May be null.
See Also:
setLastBuildDate(java.util.Date), getLastBuildDateString()

getCategories

public List<Category> getCategories()
Returns a list of one or more categories that the channel belongs to. In RSS 2.0, a provision is made for linking a channel to its identifier in a cataloging system, using the category feature. For example, to link a channel to its Syndic8 identifier, include a category element as a sub-element of Channel, with domain "Syndic8", and value the identifier for your channel in the Syndic8 database. The appropriate category element for Scripting News would be <category domain="Syndic8">1765</category>. Example: "Newspapers". The list is initially empty.

Returns:
a list of categories. May be empty but not null.
Since:
0.92
See Also:
addCategory(christophedelory.rss.Category)

addCategory

public void addCategory(Category category)
Specifies a category that the channel belongs to.

Parameters:
category - a category. Shall not be null.
Throws:
NullPointerException - if category is null.
Since:
0.92
See Also:
getCategories()

setGenerator

public void setGenerator(String generator)
Initializes the string indicating the program used to generate the channel.

Parameters:
generator - the channel's generator. May be null.
Since:
2.0
See Also:
getGenerator()

getGenerator

public String getGenerator()
Returns a string indicating the program used to generate the channel. Example: "MightyInHouse Content System v2.3". No default value.

Returns:
the channel's generator. May be null.
Since:
2.0
See Also:
setGenerator(java.lang.String)

setDocs

public void setDocs(String docs)
Initializes the URL that points to the documentation for the format used in the RSS file.

Parameters:
docs - an URL as a string. May be null.
See Also:
getDocs()

getDocs

public String getDocs()
Returns an URL that points to the documentation for the format used in the RSS file. It's probably a pointer to . It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is. Example: "http://blogs.law.harvard.edu/tech/rss". Defaults to "http://blogs.law.harvard.edu/tech/rss".

Returns:
an URL as a string. May be null.
See Also:
setDocs(java.lang.String)

setCloud

public void setCloud(Cloud cloud)
Initializes the RSS cloud descriptor.

Parameters:
cloud - a cloud descriptor. May be null.
Since:
0.92
See Also:
getCloud()

getCloud

public Cloud getCloud()
Returns a RSS cloud descriptor. Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds. No default value.

Returns:
a cloud descriptor. May be null.
Since:
0.92
See Also:
setCloud(christophedelory.rss.Cloud)

setTTL

public void setTTL(Integer ttl)
Initializes the number of minutes that indicates how long a channel can be cached before refreshing from the source.

Parameters:
ttl - the channel's TTL. May be null.
Since:
2.0
See Also:
getTTL()

getTTL

public Integer getTTL()
Returns a number of minutes that indicates how long a channel can be cached before refreshing from the source. TTL stands for time to live. This makes it possible for RSS sources to be managed by a file-sharing network such as Gnutella. Example: "60". No default value.

Returns:
the channel's TTL. May be null.
Since:
2.0
See Also:
setTTL(java.lang.Integer)

setImage

public void setImage(Image image)
Initializes a GIF, JPEG or PNG image that can be displayed with the channel.

Parameters:
image - an image descriptor. May be null.
See Also:
getImage()

getImage

public Image getImage()
Returns a GIF, JPEG or PNG image that can be displayed with the channel. No default value.

Returns:
an image descriptor. May be null.
See Also:
setImage(christophedelory.rss.Image)

setRating

public void setRating(String rating)
Initializes the PICS rating for the channel.

Parameters:
rating - a PICS rating. May be null.
See Also:
getRating()

getRating

public String getRating()
Returns the PICS rating for the channel. No default value.

Returns:
a PICS rating. May be null.
See Also:
setRating(java.lang.String)

setTextInput

public void setTextInput(TextInput textInput)
Initializes a text input box that can be displayed with the channel.

Parameters:
textInput - the text input descriptor. May be null.
See Also:
getTextInput()

getTextInput

public TextInput getTextInput()
Returns a text input box that can be displayed with the channel. No default value.

Returns:
the text input descriptor. May be null.
See Also:
setTextInput(christophedelory.rss.TextInput)

getSkipHours

public List<Integer> getSkipHours()
Returns a hint for aggregators telling them which hours they can skip. Contains up to 24 "hour" sub-elements whose value is a number between 0 and 23, representing a time in GMT, when aggregators, if they support the feature, may not read the channel on hours listed in the skipHours element. The hour beginning at midnight is hour zero. The list is initially empty.
This element came from scriptingNews format, designed in late 1997, and adopted by Netscape in RSS 0.91 in the spring of 1999.

Returns:
a list of "hour" elements. May be empty but not null.
See Also:
addSkipHour(java.lang.Integer)

addSkipHour

public void addSkipHour(Integer skipHour)
Adds an "hour" sub-element which value is a number between 0 and 23, representing a time in GMT.

Parameters:
skipHour - an "hour" element. Shall not be null.
Throws:
NullPointerException - if skipHour is null.
See Also:
getSkipHours()

getSkipDays

public List<String> getSkipDays()
Returns a hint for aggregators telling them which days they can skip. Contains up to seven "day" sub-elements whose value is Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday. Aggregators may not read the channel during days listed in the skipDays element. No default value. The list is initially empty.
This element came from scriptingNews format, designed in late 1997, and adopted by Netscape in RSS 0.91 in the spring of 1999.

Returns:
a list of "day" elements. May be empty but not null.
See Also:
addSkipDay(java.lang.String)

addSkipDay

public void addSkipDay(String skipDay)
Adds a "day" sub-element which value is Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday.

Parameters:
skipDay - a "day" element. Shall not be null.
Throws:
NullPointerException - if skipDay is null.
See Also:
getSkipDays()

getItems

public List<Item> getItems()
Returns the list of channel's items. There can be no more than 15 items in a 0.91 channel (not checked). There are no XML-level limits in RSS 0.92 and greater. Processors may impose their own limits, and generators may have preferences that say no more than a certain number of items can appear in a channel. The list is initially empty.

Returns:
a list of items. May be empty but not null.
See Also:
addItem(christophedelory.rss.Item)

addItem

public void addItem(Item item)
Adds an item to this channel.

Parameters:
item - a channel's item. Shall not be null.
Throws:
NullPointerException - if item is null.
See Also:
getItems()

setRSS

void setRSS(RSS rss)
Initializes the parent RSS document.

Parameters:
rss - the parent RSS element. May be null.
See Also:
getRSS()

getRSS

public RSS getRSS()
Returns the parent RSS document, if any.

Returns:
the parent RSS document. May be null.

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.