org.tentackle.util
Class CSVWriter

java.lang.Object
  extended by org.tentackle.util.CSVWriter

public class CSVWriter
extends Object

Generic writer for CSV-Files.

Author:
harald

Constructor Summary
CSVWriter(Writer writer)
          Creates a CSV-Writer.
 
Method Summary
 void formatCSVObject(CSVObject object)
          Writes an object to a CSV-stream.
 char getFieldDelimiter()
          Fets the field delimiter.
 int getObjectCount()
          Gets the number of written objects.
 char getQuoteCharacter()
          Gets the quote character.
 void setFieldDelimiter(char fieldDelimiter)
          Sets the field delimiter.
 void setQuoteCharacter(char quoteCharacter)
          Sets the quote character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVWriter

public CSVWriter(Writer writer)
Creates a CSV-Writer.

Parameters:
writer - the output stream to write to
Method Detail

formatCSVObject

public void formatCSVObject(CSVObject object)
                     throws ApplicationException
Writes an object to a CSV-stream.

Parameters:
object - the object to be written
Throws:
ApplicationException - if some error

getObjectCount

public int getObjectCount()
Gets the number of written objects.

Returns:
the number of converted objects

getFieldDelimiter

public char getFieldDelimiter()
Fets the field delimiter.

Returns:
the field delimiter.

setFieldDelimiter

public void setFieldDelimiter(char fieldDelimiter)
Sets the field delimiter.

Parameters:
fieldDelimiter - the delimiter, default is comma

getQuoteCharacter

public char getQuoteCharacter()
Gets the quote character.

Returns:
the quote character.

setQuoteCharacter

public void setQuoteCharacter(char quoteCharacter)
Sets the quote character.

Parameters:
quoteCharacter - the quote character, default is double-quote


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de