Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

sosc::CsvTool Class Reference

List of all members.

Static Public Methods

List csvToList (File csvFile, String[] columnOrder) throws Exception
List csvToList (StringBuffer sb, String[] columnOrder) throws Exception
List csvToList (Reader reader, String[] columnOrder) throws Exception
StringBuffer listOfListsToCsv (List list) throws Exception
StringBuffer listOfListsToCsv (List list, StringBuffer sb) throws Exception
StringBuffer resultSetToCsv (ResultSet resultSet) throws Exception
StringBuffer resultSetToCsv (ResultSet resultSet, StringBuffer b, String[] columns) throws Exception
String[] csvLine (String line) throws Exception

Static Private Attributes

Logger logger = Logger.getLogger("net.threebit.utils.sosc")

Member Function Documentation

String [] sosc::CsvTool::csvLine String    line throws Exception [inline, static]
 

A simple csv line tokenizer that is more robust than anything else in this class. Other methods should be modified to make use of it instead of their own "split on comma" logic (which causes alot of problems).

A null or empty line is allowed - a String[] of size 0 is returned.

Definition at line 294 of file CsvTool.java.

List sosc::CsvTool::csvToList Reader    reader,
String    columnOrder[]
throws Exception [inline, static]
 

Definition at line 53 of file CsvTool.java.

List sosc::CsvTool::csvToList StringBuffer    sb,
String    columnOrder[]
throws Exception [inline, static]
 

Definition at line 46 of file CsvTool.java.

References sosc::CsvTool::csvToList().

List sosc::CsvTool::csvToList File    csvFile,
String    columnOrder[]
throws Exception [inline, static]
 

Definition at line 42 of file CsvTool.java.

Referenced by sosc::CsvTool::csvToList().

StringBuffer sosc::CsvTool::listOfListsToCsv List    list,
StringBuffer    sb
throws Exception [inline, static]
 

Definition at line 184 of file CsvTool.java.

StringBuffer sosc::CsvTool::listOfListsToCsv List    list throws Exception [inline, static]
 

Definition at line 177 of file CsvTool.java.

StringBuffer sosc::CsvTool::resultSetToCsv ResultSet    resultSet,
StringBuffer    b,
String    columns[]
throws Exception [inline, static]
 

Converts the given ResultSet to a string buffer in CSV format. The contents of the string buffer are not cleared in advance.

Parameters:
resultSet  The result set to convert. The current position of the result set is used as the first line. You may need to call "next()" or "first()" before invoking this function.

Parameters:
b  The string buffer to append the CSV data to. The contents of the buffer are not cleared before processing.

Parameters:
columns  If null then all of the columns from the result set are converted using whatever order the result set metadata provides. If not null, then only those columns are returned and the exact ordering of the columns is retained.

Returns:
The same string buffer that was provided.

Exceptions:
Exception  if:
  • A specified column is not contained in the result set.
  • The string buffer was null.
  • The result set was null.

Definition at line 236 of file CsvTool.java.

StringBuffer sosc::CsvTool::resultSetToCsv ResultSet    resultSet throws Exception [inline, static]
 

Just a wrapper for return resultSetToCsv(resultSet,new StringBuffer(),null);

Definition at line 206 of file CsvTool.java.


Member Data Documentation

Logger sosc::CsvTool::logger = Logger.getLogger("net.threebit.utils.sosc") [static, private]
 

Debugging.

Definition at line 37 of file CsvTool.java.


The documentation for this class was generated from the following file:
Generated on Mon Jul 14 17:19:21 2003 for SOSC by doxygen1.2.15