org.tentackle.util
Class CSVObjectAdapter

java.lang.Object
  extended by org.tentackle.util.CSVObjectAdapter
All Implemented Interfaces:
CSVObject

public class CSVObjectAdapter
extends Object
implements CSVObject

An adapter for a CSVObject.

Author:
harald

Constructor Summary
CSVObjectAdapter()
           
 
Method Summary
 String formatCSVField(int index)
          Returns the string-representation for a csv-value.
 int getCSVFieldCount()
          Returns the number of csv-fields to format for the current object.
 void parseCSVField(int index, String value)
          Parses a field and stores it in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVObjectAdapter

public CSVObjectAdapter()
Method Detail

formatCSVField

public String formatCSVField(int index)
                      throws ApplicationException
Description copied from interface: CSVObject
Returns the string-representation for a csv-value.

Specified by:
formatCSVField in interface CSVObject
Parameters:
index - the index of the field in the CSV-Stream (starting at 0)
Returns:
the formatted string
Throws:
ApplicationException - if formatting failed

getCSVFieldCount

public int getCSVFieldCount()
                     throws ApplicationException
Description copied from interface: CSVObject
Returns the number of csv-fields to format for the current object.

Specified by:
getCSVFieldCount in interface CSVObject
Returns:
the number of fields in this object
Throws:
ApplicationException - if calculating the number of fields failed

parseCSVField

public void parseCSVField(int index,
                          String value)
                   throws ApplicationException
Description copied from interface: CSVObject
Parses a field and stores it in this object.

Specified by:
parseCSVField in interface CSVObject
Parameters:
index - the index of the field in the CSV-Object (starting at 0)
value - the string-value. null if empty non-quoted field.
Throws:
ApplicationException - if setting the value failes for some reason


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