Parsing Engine

danbikel.switchboard
Interface ObjectWriterFactory

All Known Implementing Classes:
EventCountsWriterFactory, TextObjectWriterFactory

public interface ObjectWriterFactory

A specification for constructing ObjectWriter instances. This type of factory is used by the switchboard.

See Also:
ObjectWriter, Switchboard

Method Summary
 ObjectWriter get(OutputStream os, boolean append, boolean emptyFile)
          Returns a newly-constructed ObjectWriter using the specified stream.
 ObjectWriter get(OutputStream os, String encoding, int bufSize, boolean append, boolean emptyFile)
          Returns a newly-constructed ObjectWriter using the specified stream.
 ObjectWriter get(String filename, String encoding, int bufSize, boolean append)
          Returns a newly-constructed ObjectWriter using the specified stream.
 

Method Detail

get

ObjectWriter get(OutputStream os,
                 boolean append,
                 boolean emptyFile)
                 throws IOException
Returns a newly-constructed ObjectWriter using the specified stream. The two final arguments, append and emptyFile, should be used to determine whether stream header information needs to be written (by stream implementations that use headers, such as ObjectOutputStream).

Parameters:
os - the output stream around which to build an ObjectWriter
append - if true, indicates that the output stream belongs to a file that is being appended to
emptyFile - indicates whether the underlying file (if there is one) for the output stream is currently empty
Throws:
IOException

get

ObjectWriter get(OutputStream os,
                 String encoding,
                 int bufSize,
                 boolean append,
                 boolean emptyFile)
                 throws IOException
Returns a newly-constructed ObjectWriter using the specified stream. If the underlying writer is character-based, the encoding argument will be used; otherwise, it will be ignored. The bufSize argument should be used by ObjectWriter implementations for construction of a buffered stream or Writer. The two final arguments, append and emptyFile, should be used to determine whether stream header information needs to be written (by stream implementations that use headers, such as ObjectOutputStream).

Parameters:
os - the output stream around which to build an ObjectWriter
encoding - the character encoding to be used (ignored if the ObjectWriter implementor returned by this factory is not character-based)
bufSize - the suggested buffer size to be used by ObjectWriter objects returned by this factory
append - if true, indicates that the output stream belongs to a file that is being appended to
emptyFile - indicates whether the underlying file (if there is one) for the output stream is currently empty
Throws:
IOException

get

ObjectWriter get(String filename,
                 String encoding,
                 int bufSize,
                 boolean append)
                 throws IOException
Returns a newly-constructed ObjectWriter using the specified stream. If the underlying writer is character-based, the encoding argument will be used; otherwise, it will be ignored. The bufSize argument should be used by ObjectWriter implementations for construction of a buffered stream or Writer.

Parameters:
filename - the name of an output file around which to build an ObjectWriter
encoding - the character encoding to be used (ignored if the ObjectWriter implementor returned by this factory is not character-based)
bufSize - the suggested buffer size to be used by ObjectWriter objects returned by this factory
append - indicates whether to append to the opened file
Throws:
IOException

Parsing Engine

Author: Dan Bikel.