net.sourceforge.jdbcexporter.formatter
Class PatternDelimiterFormatter

java.lang.Object
  extended bynet.sourceforge.jdbcexporter.formatter.PatternDelimiterFormatter
All Implemented Interfaces:
DelimiterFormatter

public class PatternDelimiterFormatter
extends java.lang.Object
implements DelimiterFormatter

The PatternDelimiterFormatter class implements the DelimiterFormatter interface to format column values in a java.text.MessageFormat pattern. It uses a custom Format class that includes several enhancements. The first column value will be placed into the pattern where '{1}' is found.

Since:
0.61
Version:
0.61
Author:
Chris Nagy
See Also:
CustomMessageFormat

Constructor Summary
PatternDelimiterFormatter()
           
 
Method Summary
 void finish()
          Finishs the writing of rows to the output source.
 java.lang.String formatValues(ColumnValue[] values)
          Creates a string representing the row of column values.
 void setPattern(java.lang.String pattern)
          Sets the pattern to use when formatting the values.
 void setWriter(java.io.Writer output)
          Sets the output source for the formatter.
 void writeNextRow(java.lang.String row)
          Writes the next row to the output source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternDelimiterFormatter

public PatternDelimiterFormatter()
Method Detail

setPattern

public void setPattern(java.lang.String pattern)
Sets the pattern to use when formatting the values.

Parameters:
pattern - the pattern

setWriter

public void setWriter(java.io.Writer output)
Description copied from interface: DelimiterFormatter
Sets the output source for the formatter.

Specified by:
setWriter in interface DelimiterFormatter
Parameters:
output - the destination of the data
See Also:
DelimiterFormatter.setWriter(java.io.Writer)

formatValues

public java.lang.String formatValues(ColumnValue[] values)
Description copied from interface: DelimiterFormatter
Creates a string representing the row of column values.

Specified by:
formatValues in interface DelimiterFormatter
Parameters:
values - the column values
Returns:
the string
See Also:
DelimiterFormatter.formatValues(net.sourceforge.jdbcimporter.ColumnValue[])

writeNextRow

public void writeNextRow(java.lang.String row)
                  throws java.io.IOException
Description copied from interface: DelimiterFormatter
Writes the next row to the output source.

Specified by:
writeNextRow in interface DelimiterFormatter
Parameters:
row - the next row
Throws:
java.io.IOException - if an error occurs while writing the next row
See Also:
DelimiterFormatter.writeNextRow(java.lang.String)

finish

public void finish()
            throws java.io.IOException
Description copied from interface: DelimiterFormatter
Finishs the writing of rows to the output source.

Specified by:
finish in interface DelimiterFormatter
Throws:
java.io.IOException
See Also:
DelimiterFormatter.finish()