: Class RSSChannel
com.exploringxml.rss
Class RSSChannel
java.lang.Object
|
+--com.exploringxml.rss.RSSChannel
- public class RSSChannel
- extends java.lang.Object
Reads in a Rich Site Summary (RSS) file and populates its members
with the parsed content of the file
does not depend on external XML parser anymore
|
Method Summary |
java.net.URL |
getChannelLink()
gets the channel's associated URL |
java.lang.String |
getChannelTitle()
gets the title of the RSS channel |
java.net.URL |
getItemLink(int pos)
gets the associated link of the referenced channel item |
java.lang.String |
getItemTitle(int pos)
gets the title of the referenced channel item |
int |
getNumberOfItems()
gets the number of items in the channel |
void |
load(java.lang.String srcURL)
loads an RSS file from a URL |
private java.lang.String |
readChannel(java.lang.String srcURL)
|
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
channelTitle
private java.lang.String channelTitle
channelLink
private java.net.URL channelLink
items
private java.util.Vector items
root
private Node root
RSSChannel
public RSSChannel()
load
public void load(java.lang.String srcURL)
throws java.lang.Exception
- loads an RSS file from a URL
- Parameters:
srcURL - the URL to load from- Throws:
- java.lang.Exception - mostly @see java.io.IOException or @see java.net.MalformedURLException
readChannel
private java.lang.String readChannel(java.lang.String srcURL)
throws java.lang.Exception
getChannelTitle
public java.lang.String getChannelTitle()
- gets the title of the RSS channel
- Returns:
- String denoting the RSS channel's title
getChannelLink
public java.net.URL getChannelLink()
- gets the channel's associated URL
- Returns:
- URL denoting the channel's link
getItemTitle
public java.lang.String getItemTitle(int pos)
- gets the title of the referenced channel item
- Parameters:
item - the item in the channel list- Returns:
- String denoting the channel item's title
getItemLink
public java.net.URL getItemLink(int pos)
- gets the associated link of the referenced channel item
- Parameters:
item - the item in the channel list- Returns:
- URL denoting the channel item's associated link
getNumberOfItems
public int getNumberOfItems()
- gets the number of items in the channel
- Returns:
- the number of items