net.sf.flatpack.writer
Class DelimiterWriter

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

public class DelimiterWriter
extends AbstractWriter

Author:
Dirk Holmes and Holger Holger Hoffstatte

Constructor Summary
protected DelimiterWriter(java.util.Map columnMapping, java.io.Writer output, char delimiter, char qualifier)
           
 
Method Summary
protected  void addColumnTitle(java.lang.String string)
           
 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.
protected  void write(java.lang.Object value)
           
protected  void writeColumnTitles()
           
protected  void writeRow()
           
protected  void writeWithDelimiter(java.lang.Object value)
           
 
Methods inherited from class net.sf.flatpack.writer.AbstractWriter
addRecordEntry, close, flush, getRowMap, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimiterWriter

protected DelimiterWriter(java.util.Map columnMapping,
                          java.io.Writer output,
                          char delimiter,
                          char qualifier)
                   throws java.io.IOException
Throws:
java.io.IOException
Method Detail

writeWithDelimiter

protected void writeWithDelimiter(java.lang.Object value)
                           throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.lang.Object value)
              throws java.io.IOException
Overrides:
write in class AbstractWriter
Throws:
java.io.IOException

addColumnTitle

protected void addColumnTitle(java.lang.String string)

writeColumnTitles

protected void writeColumnTitles()
                          throws java.io.IOException
Throws:
java.io.IOException

writeRow

protected void writeRow()
                 throws java.io.IOException
Throws:
java.io.IOException

nextRecord

public final 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

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?


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.


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