it.sauronsoftware.feed4j.bean
Class FeedItem

java.lang.Object
  extended by it.sauronsoftware.feed4j.bean.RawElement
      extended by it.sauronsoftware.feed4j.bean.FeedItem
All Implemented Interfaces:
RawNode

public class FeedItem
extends RawElement

This class is used to represent the items in a feed.

Author:
Carlo Pelliccia

Constructor Summary
FeedItem()
           
 
Method Summary
 void addEnclosure(FeedEnclosure enclosure)
          This method adds an enclosure to the item.
 java.net.URL getComments()
          This method returns the URL for the comments to the item.
 java.lang.String getDescriptionAsHTML()
          This method returns the item description as HTML code.
 java.lang.String getDescriptionAsText()
          This method returns the item description as plain text.
 FeedEnclosure getEnclosure(int index)
          This method returns one of the item enclosures.
 int getEnclosureCount()
          This method returns the number of the feed enclosures.
 java.lang.String getGUID()
          This method returns the item GUID, used to identify it universally.
 java.net.URL getLink()
          This method returns the item link.
 java.util.Date getModDate()
          This method returns the item latest modification date.
 java.util.Date getPubDate()
          This method returns the item publication date.
 java.lang.String getTitle()
          This method returns the item title.
 void setComments(java.net.URL comments)
          This method sets the URL for the comments to the item.
 void setDescriptionAsHTML(java.lang.String descriptionAsHTML)
          This method sets the item description as HTML code.
 void setDescriptionAsText(java.lang.String descriptionAsText)
          This method sets the item description as plain text.
 void setGUID(java.lang.String guid)
          This method sets the item GUID.
 void setLink(java.net.URL link)
          This method sets the item link.
 void setModDate(java.util.Date modDate)
          This method sets the item latest modification date.
 void setPubDate(java.util.Date pubDate)
          This method sets the item publication date.
 void setTitle(java.lang.String title)
          This method sets the item title.
 
Methods inherited from class it.sauronsoftware.feed4j.bean.RawElement
addAttribute, addNode, getAttribute, getAttributeCount, getAttributeValue, getElement, getElements, getElementValue, getName, getNamespaceURI, getNode, getNodeCount, getValue, removeNode, setName, setNamespaceURI, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedItem

public FeedItem()
Method Detail

getComments

public java.net.URL getComments()
This method returns the URL for the comments to the item. It could be null.

Returns:
The URL for the comments to the item (it could be null).

setComments

public void setComments(java.net.URL comments)
This method sets the URL for the comments to the item.

Parameters:
comments - The URL for the comments to the item.

getGUID

public java.lang.String getGUID()
This method returns the item GUID, used to identify it universally. It's very unusual that two non-equivalent items have the same GUID.

Returns:
The item GUID.

setGUID

public void setGUID(java.lang.String guid)
This method sets the item GUID.

Parameters:
guid - The item GUID. universalmente.

getLink

public java.net.URL getLink()
This method returns the item link.

Returns:
The item link.

setLink

public void setLink(java.net.URL link)
This method sets the item link.

Parameters:
link - The item link.

getPubDate

public java.util.Date getPubDate()
This method returns the item publication date. It could be null.

Returns:
The item publication date (it could be null).

setPubDate

public void setPubDate(java.util.Date pubDate)
This method sets the item publication date.

Parameters:
pubDate - The item publication date.

getTitle

public java.lang.String getTitle()
This method returns the item title.

Returns:
The item title.

setTitle

public void setTitle(java.lang.String title)
This method sets the item title.

Parameters:
title - The item title.

addEnclosure

public void addEnclosure(FeedEnclosure enclosure)
This method adds an enclosure to the item.

Parameters:
enclosure - The item enclosure.

getEnclosure

public FeedEnclosure getEnclosure(int index)
                           throws java.lang.IndexOutOfBoundsException
This method returns one of the item enclosures.

Parameters:
index - The index of the wanted enclosure-
Returns:
The item enclosure.
Throws:
java.lang.IndexOutOfBoundsException - If the index supplied is not valid. It must be greater or equal to 0 and less than the value returned by getEnclosureCount().

getEnclosureCount

public int getEnclosureCount()
This method returns the number of the feed enclosures.

Returns:
The number of the feed enclosures.

getModDate

public java.util.Date getModDate()
This method returns the item latest modification date. It could be null.

Returns:
The item latest modification date (it could be null).

setModDate

public void setModDate(java.util.Date modDate)
This method sets the item latest modification date.

Parameters:
modDate - The item latest modification date.

getDescriptionAsHTML

public java.lang.String getDescriptionAsHTML()
This method returns the item description as HTML code. It could be null if no description is supplied. If no HTML description is supplied, but a plain text one is given, the HTML description is encoded automatically starting from the plain text one.

Returns:
The item description as HTML code (it could be null).

setDescriptionAsHTML

public void setDescriptionAsHTML(java.lang.String descriptionAsHTML)
This method sets the item description as HTML code.

Parameters:
descriptionAsHTML - The item description as HTML code.

getDescriptionAsText

public java.lang.String getDescriptionAsText()
This method returns the item description as plain text. It could be null if no description is supplied. If no plain text description is supplied, but a HTML encoded one is given, the plain text description is extracted automatically starting from the HTML one.

Returns:
The item description as plain text (it could be null).

setDescriptionAsText

public void setDescriptionAsText(java.lang.String descriptionAsText)
This method sets the item description as plain text.

Parameters:
descriptionAsText - The item description as plain text.