com.blackledge.david.tivo.gadgets
Class RSSItem

java.lang.Object
  extended by com.blackledge.david.tivo.gadgets.RSSItem

public class RSSItem
extends Object

Simple bean to hold the elements of a RSS XML item, designed fr use with RSSListScreen

Version:
$Revision: 1.2 $

Constructor Summary
RSSItem(Element element)
           
 
Method Summary
protected  List getChildElementsByTagName(Element parentElement, String name)
          Often we want to work with all the subtags of a given name (or just all subtags) - this gets them for us.
 String getDescription()
           
 int getEnclosureLength()
           
 String getEnclosureType()
           
 String getEnclosureUrl()
           
protected  String getNodeValue(Node element)
          Typically we want the text value contained within a tag...
 Date getPubDate()
           
protected  Element getSingleChildElementByTagName(Element parentElement, String name)
          Often we know we want one subtag and it won't appear more than once, this gets it for us.
 String getTitle()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RSSItem

public RSSItem(Element element)
Parameters:
element - the XML "item" element in the rss feed.
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getTitle

public String getTitle()

getDescription

public String getDescription()

getPubDate

public Date getPubDate()

getEnclosureUrl

public String getEnclosureUrl()

getEnclosureLength

public int getEnclosureLength()

getEnclosureType

public String getEnclosureType()

getSingleChildElementByTagName

protected Element getSingleChildElementByTagName(Element parentElement,
                                                 String name)
Often we know we want one subtag and it won't appear more than once, this gets it for us.

Parameters:
parentElement -
name - may not be null.
Returns:
the named Tag, or null if that named tag isn't a child of this parentElement.

getChildElementsByTagName

protected List getChildElementsByTagName(Element parentElement,
                                         String name)
Often we want to work with all the subtags of a given name (or just all subtags) - this gets them for us.

Parameters:
parentElement -
name - - null means accept all tag names into the list.
Returns:
List containing only Element instances. never null

getNodeValue

protected String getNodeValue(Node element)
Typically we want the text value contained within a tag... this gets it, or null if anything along the path to getting it is null.

Parameters:
element -
Returns:
a String value (trimmed) or null