org.jmonks.batch.io.flat
Class FixedWidthFlatFileWriter
java.lang.Object
org.jmonks.batch.io.FileWriter
org.jmonks.batch.io.flat.FlatFileWriter
org.jmonks.batch.io.flat.FixedWidthFlatFileWriter
- public class FixedWidthFlatFileWriter
- extends FlatFileWriter
FixedWidthFlatFileWriter writes the file according to the given file spec
with the data submitted in the form of WriterRecord's. This provides the methods
to create the required writer records and write the writer record into the file writer.
Once finished writing of all the records file writer should be closed by calling
the "close" method.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Suresh Pragada
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedWidthFlatFileWriter
public FixedWidthFlatFileWriter(java.io.OutputStream outputStream,
FileSpec fileSpec)
- Constructs and initializes the writer with the given values.
- Parameters:
outputStream
- Output stream to write the records.fileSpec
- File spec to be used to generate the file.
FixedWidthFlatFileWriter
public FixedWidthFlatFileWriter(java.io.Writer writer,
FileSpec fileSpec)
- Constructs and initializes the writer with the given values.
- Parameters:
writer
- Writer to write the records.fileSpec
- File spec to be used to generate the file.
generateRecord
protected java.lang.String generateRecord(WriterRecord writerRecord)
throws java.io.IOException
- Writes the given record into the file/writer.
- Specified by:
generateRecord
in class FlatFileWriter
- Parameters:
writerRecord
- Record consist of field names and values.
- Returns:
- Returns the string representation of the record.
- Throws:
java.lang.IllegalStateException
- If writer is closed and trying to write the recrod.
java.lang.IllegalArgumentException
- If writer record is null.
FileParseException
- Problems while trying to write the record.
java.io.IOException