com.ricebridge.csvman
Class CsvWriter

java.lang.Object
  extended bycom.ricebridge.csvman.CsvWriter

public class CsvWriter
extends Object

Internal class. Use once per output process.


Constructor Summary
CsvWriter(Writer pWriter, CsvSpec pCsvSpec)
          Create a new CsvWriter wrapping a Writer, with settings from a CsvSpec.
 
Method Summary
static String formatField(String pField, String pEol, CsvSpec pCsvSpec)
          Format data field (escape, quote, etc.) as String for output.
 int getLineCount()
          Get the number of lines output so far.
static String makeEol(CsvSpec pCsvSpec)
          Heuristic creation of line ending for current platform and settings.
static String makeSep(CsvSpec pCsvSpec)
          Make separator character from settings.
 void write(String[] pLine)
          Exception handling must be done by calling code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvWriter

public CsvWriter(Writer pWriter,
                 CsvSpec pCsvSpec)
Create a new CsvWriter wrapping a Writer, with settings from a CsvSpec.

Method Detail

write

public void write(String[] pLine)
           throws Exception
Exception handling must be done by calling code.

Throws:
Exception

getLineCount

public int getLineCount()
Get the number of lines output so far.


makeEol

public static String makeEol(CsvSpec pCsvSpec)
Heuristic creation of line ending for current platform and settings.


makeSep

public static String makeSep(CsvSpec pCsvSpec)
Make separator character from settings.


formatField

public static String formatField(String pField,
                                 String pEol,
                                 CsvSpec pCsvSpec)
Format data field (escape, quote, etc.) as String for output.

Parameters:
pField - data field source text


Copyright © 2003-2006 Ricebridge