org.objectweb.telosys.dal.csv
Class CSVReader

java.lang.Object
  extended byorg.objectweb.telosys.dal.csv.CSVReader

public class CSVReader
extends java.lang.Object

A "SAX like" parser to process CSV files.
As the content is parsed by the underlying parser, methods of the given Handler are called.


Constructor Summary
CSVReader(char cSepar, ICSVHandler handler)
          Construct a CSVReader object initialized with a separator and a handler
CSVReader(java.lang.String sSepar, ICSVHandler handler)
          Construct a CSVReader object initialized with a separator and a handler
 
Method Summary
 void parse(java.io.BufferedReader br)
          Parse the input specified, using the current Handler.
 void parse(java.lang.String sFileName)
          Parse the content of the file specified, using the current Handler.
 void setComment(java.lang.String sComment)
          Set the comment string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVReader

public CSVReader(char cSepar,
                 ICSVHandler handler)
Construct a CSVReader object initialized with a separator and a handler

Parameters:
cSepar - - the field separator
handler - - the CSV handler to use

CSVReader

public CSVReader(java.lang.String sSepar,
                 ICSVHandler handler)
Construct a CSVReader object initialized with a separator and a handler

Parameters:
sSepar - - the field separator (use only the first character of the string)
handler - - the CSV handler to use
Method Detail

setComment

public void setComment(java.lang.String sComment)
Set the comment string

Parameters:
sComment - - the string which identify a comment

parse

public void parse(java.lang.String sFileName)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Parse the content of the file specified, using the current Handler.

Parameters:
sFileName - - the name of the file to parse
Throws:
java.io.FileNotFoundException
java.io.IOException

parse

public void parse(java.io.BufferedReader br)
           throws java.io.IOException
Parse the input specified, using the current Handler.

Parameters:
br - - the BufferedReader to parse
Throws:
java.io.FileNotFoundException
java.io.IOException