yarfraw.io
Class FeedWriter

java.lang.Object
  extended by yarfraw.io.FeedWriter

public class FeedWriter
extends Object

Provides a set of function to facilitate writing to a feed.
*Note* This class is not thread safe.

Author:
jliang

Field Summary
protected  File _file
           
protected  FeedFormat _format
           
 
Constructor Summary
FeedWriter(File file)
           
FeedWriter(File file, FeedFormat format)
           
FeedWriter(String pathName)
           
FeedWriter(String pathName, FeedFormat format)
           
FeedWriter(URI uri)
           
FeedWriter(URI uri, FeedFormat format)
           
 
Method Summary
 File getFile()
           
 FeedFormat getFormat()
          The FeedFormat this writer should be using.
if this is not set, the default is RSS 2.0 format.
 void setFile(File file)
           
 void setFormat(FeedFormat format)
          The FeedFormat this writer should be using.
if this is not set, the default is RSS 2.0 format.
 void writeChannel(ChannelFeed channel)
          Writes a channel to the feed file with a custom ValidationEventHandler
 void writeChannel(ChannelFeed channel, ValidationEventHandler validationEventHandler)
          Writes a channel to the feed file with a custom ValidationEventHandler.
static void writeChannel(FeedFormat format, ChannelFeed channel, OutputStream outputStream)
          Writes a channel to the feed file with a custom ValidationEventHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_file

protected File _file

_format

protected FeedFormat _format
Constructor Detail

FeedWriter

public FeedWriter(File file,
                  FeedFormat format)

FeedWriter

public FeedWriter(String pathName,
                  FeedFormat format)

FeedWriter

public FeedWriter(URI uri,
                  FeedFormat format)

FeedWriter

public FeedWriter(File file)

FeedWriter

public FeedWriter(String pathName)

FeedWriter

public FeedWriter(URI uri)
Method Detail

writeChannel

public void writeChannel(ChannelFeed channel)
                  throws YarfrawException
Writes a channel to the feed file with a custom ValidationEventHandler

Parameters:
channel - a valid ChannelFeed
Throws:
YarfrawException - if write operation failed.

writeChannel

public static void writeChannel(FeedFormat format,
                                ChannelFeed channel,
                                OutputStream outputStream)
                         throws YarfrawException
Writes a channel to the feed file with a custom ValidationEventHandler.

Parameters:
format - any valid FeedFormat
channel - a valid ChannelFeed
outputStream - an OutputStream
Throws:
YarfrawException - if write operation failed.

writeChannel

public void writeChannel(ChannelFeed channel,
                         ValidationEventHandler validationEventHandler)
                  throws YarfrawException
Writes a channel to the feed file with a custom ValidationEventHandler.

Parameters:
channel - a valid ChannelFeed
validationEventHandler - a custom ValidationEventHandler
Throws:
YarfrawException - if write operation failed.

getFile

public File getFile()

setFile

public void setFile(File file)

getFormat

public FeedFormat getFormat()
The FeedFormat this writer should be using.
if this is not set, the default is RSS 2.0 format. null format is ignored

rss 2.0 is recommended, use other format if you really need to


setFormat

public void setFormat(FeedFormat format)
The FeedFormat this writer should be using.
if this is not set, the default is RSS 2.0 format. null format is ignored

rss 2.0 is recommended, use other format if you really need to



Copyright © 2008. All Rights Reserved.