| org.clapper.curn.OutputHandler
All known Subclasses: org.clapper.curn.output.FileOutputHandler, org.clapper.curn.ReadOnlyOutputHandler,
OutputHandler | public interface OutputHandler (Code) | | This interface defines the methods that must be supported by a class
that is to be plugged into curn as an output handler. It is
responsible for writing any channel headers, item headers, and item
information. It will only be called with items that should be displayed;
any channel items that are cached and should be skipped are not handed
to the output handler. curn models output in this manner to make
it simpler to substitute different kinds of output handlers.
See Also: Curn See Also: OutputHandlerFactory See Also: org.clapper.curn.parser.RSSChannel See Also: org.clapper.curn.parser.RSSItem version: $Revision: 7041 $ |
displayChannel | public void displayChannel(RSSChannel channel, FeedInfo feedInfo) throws CurnException(Code) | | Display the list of RSSItem news items to whatever output
is defined for the underlying class. Output should be written to the
PrintWriter that was passed to the
OutputHandler.init init() method.
Parameters: channel - The parsed channel data. curn will pass acopy of the actual RSSChannel object, so theoutput handler can edit its contents, if necessary,without affecting other output handlers. Parameters: feedInfo - The feed. throws: CurnException - unable to write output |
flush | public void flush() throws CurnException(Code) | | Flush any buffered-up output and close the underlying output
stream(s), if any. curn calls this method once, after calling
displayChannelItems() for all channels. If the output
handler doesn't need to flush any output, it can simply return
without doing anything.
throws: CurnException - unable to write output |
getGeneratedOutput | public File getGeneratedOutput() throws CurnException(Code) | | Get the File that represents the output produced by the
handler, if applicable. (Use of a File, rather than an
InputStream, is more efficient when mailing the output,
since the email API ultimately wants files and will create
temporary files for InputStreams.)
the output file, or null if no suitable output was produced throws: CurnException - an error occurred |
getName | public String getName()(Code) | | Get the name of this output handler. The name must be unique.
the name |
getOutputEncoding | public String getOutputEncoding()(Code) | | Get the output encoding.
the encoding |
init | public void init(CurnConfig config, ConfiguredOutputHandler cfgHandler) throws ConfigurationException, CurnException(Code) | | Initializes the output handler for another set of RSS channels.
Parameters: config - the parsed curn configuration data. Theoutput handler is responsible for retrieving itsown parameters from the configuration, by callingconfig.getOutputHandlerSpecificVariables() Parameters: cfgHandler - the ConfiguredOutputHandler wrappercontaining this object; the wrapper has some usefulmetadata, such as the object's configuration sectionname and extra variables. throws: ConfigurationException - configuration error throws: CurnException - some other initialization error See Also: CurnConfig See Also: ConfiguredOutputHandler |
|
|