org.jperdian.rss2.rendering
Class HtmlRenderer

java.lang.Object
  |
  +--org.jperdian.rss2.rendering.HtmlRenderer
Direct Known Subclasses:
Html3Renderer

public abstract class HtmlRenderer
extends java.lang.Object

Renders the content of an RssChannel and returns the content as valid HTML

Author:
Christian Robert

Constructor Summary
HtmlRenderer()
           
 
Method Summary
 java.lang.String createStyleSheet()
          Creates the stylesheet to be used for the current document
protected  java.text.DateFormat getDateFormat()
          Gets the DateFormat to be used for displaying dates in the items
 java.lang.StringBuffer renderChannel(RssChannel channel)
          Returns the content of the given channel
protected  void renderChannelBottom(RssChannel channel, java.lang.StringBuffer buffer)
          Adds the content of the channels footer to the given output buffer
protected abstract  void renderChannelHead(RssChannel channel, java.lang.StringBuffer buffer)
          Adds the content of the channels head to the given output buffer
protected abstract  void renderChannelItem(RssChannel channel, RssItem item, int index, int totalItems, java.lang.StringBuffer buffer)
          Adds the content of the item to the given output buffer
protected  void renderHtmlBottom(java.lang.StringBuffer buffer)
          Adds the content of the HTML footer
protected  void renderHtmlHead(java.lang.StringBuffer buffer)
          Adds the content of the HTML header
 java.lang.StringBuffer renderItem(RssItem item)
          Returns the content of the given item
protected  void setDateFormat(java.text.DateFormat format)
          Sets the DateFormat to be used for displaying dates in the items
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlRenderer

public HtmlRenderer()
Method Detail

renderChannel

public java.lang.StringBuffer renderChannel(RssChannel channel)
Returns the content of the given channel


renderItem

public java.lang.StringBuffer renderItem(RssItem item)
Returns the content of the given item


renderChannelHead

protected abstract void renderChannelHead(RssChannel channel,
                                          java.lang.StringBuffer buffer)
Adds the content of the channels head to the given output buffer


renderChannelItem

protected abstract void renderChannelItem(RssChannel channel,
                                          RssItem item,
                                          int index,
                                          int totalItems,
                                          java.lang.StringBuffer buffer)
Adds the content of the item to the given output buffer


renderChannelBottom

protected void renderChannelBottom(RssChannel channel,
                                   java.lang.StringBuffer buffer)
Adds the content of the channels footer to the given output buffer


renderHtmlHead

protected void renderHtmlHead(java.lang.StringBuffer buffer)
Adds the content of the HTML header


renderHtmlBottom

protected void renderHtmlBottom(java.lang.StringBuffer buffer)
Adds the content of the HTML footer


createStyleSheet

public java.lang.String createStyleSheet()
Creates the stylesheet to be used for the current document


setDateFormat

protected void setDateFormat(java.text.DateFormat format)
Sets the DateFormat to be used for displaying dates in the items


getDateFormat

protected java.text.DateFormat getDateFormat()
Gets the DateFormat to be used for displaying dates in the items