org.tentackle.util
Interface CSVObject

All Known Implementing Classes:
CSVObjectAdapter

public interface CSVObject

CSV conversion interface.

Objects that can decoded and/or encoded to CSV format (comma separated values) must implement this interface.

Author:
harald
See Also:
CSVReader, CSVWriter

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.
 

Method Detail

parseCSVField

void parseCSVField(int index,
                   String value)
                   throws ApplicationException
Parses a field and stores it in this object.

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

formatCSVField

String formatCSVField(int index)
                      throws ApplicationException
Returns the string-representation for a csv-value.

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

getCSVFieldCount

int getCSVFieldCount()
                     throws ApplicationException
Returns the number of csv-fields to format for the current object.

Returns:
the number of fields in this object
Throws:
ApplicationException - if calculating the number of fields failed


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