net.sf.flatpack.writer
Class FixedLengthWriter

java.lang.Object
  extended by net.sf.flatpack.writer.AbstractWriter
      extended by net.sf.flatpack.writer.FixedLengthWriter
All Implemented Interfaces:
Writer

public class FixedLengthWriter
extends AbstractWriter

Author:
Dirk Holmes and Holger Holger Hoffstatte

Constructor Summary
protected FixedLengthWriter(java.util.Map parsedMapping, java.io.Writer output, char padChar)
           
 
Method Summary
 void addRecordEntry(java.lang.String columnName, java.lang.Object value)
           
protected  char[] formattedValue(java.lang.Object val, ColumnMetaData element)
           
 void nextRecord()
          Writes a newline to the output and discards the rowMap.
 void printFooter()
          put writer into footer mode.
 void printHeader()
          put writer into header mode.
protected  boolean validateColumnTitle(java.lang.String columnTitle)
          Subclasses must implement this method to perform validation of columnTitle.
 
Methods inherited from class net.sf.flatpack.writer.AbstractWriter
close, flush, getRowMap, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedLengthWriter

protected FixedLengthWriter(java.util.Map parsedMapping,
                            java.io.Writer output,
                            char padChar)
                     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

addRecordEntry

public void addRecordEntry(java.lang.String columnName,
                           java.lang.Object value)
Specified by:
addRecordEntry in interface Writer
Overrides:
addRecordEntry in class AbstractWriter

nextRecord

public void nextRecord()
                throws java.io.IOException
Description copied from class: AbstractWriter
Writes a newline to the output and discards the rowMap.

This method must be overridden by subclasses to write out the record data stored in rowMap. Overriders must call super.nextRecord() as the last call in their implementation.

Specified by:
nextRecord in interface Writer
Overrides:
nextRecord in class AbstractWriter
Throws:
java.io.IOException

formattedValue

protected char[] formattedValue(java.lang.Object val,
                                ColumnMetaData element)

validateColumnTitle

protected boolean validateColumnTitle(java.lang.String columnTitle)
Description copied from class: AbstractWriter
Subclasses must implement this method to perform validation of columnTitle.

Specified by:
validateColumnTitle in class AbstractWriter
Parameters:
columnTitle - title of the column to be filled
Returns:
true if the column title is valid else return false.

printFooter

public void printFooter()
Description copied from interface: Writer
put writer into footer mode. TODO: how to handle multiple footer lines?


printHeader

public void printHeader()
Description copied from interface: Writer
put writer into header mode. TODO: how to handle multiple header lines?



Copyright © 2006-2011 Appendium - Portfolio Financing Platform. All Rights Reserved.