|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pmease.quickbuild.plugin.report.engine.util.csv.CSVReader
public class CSVReader
Reads and parses CSV lines from an input source. Correctly handles quoted
fields which contain line terminators. The CSVReader is designed to be
similar to Reader classes and in particular is similar to the
LineNumberReader in terms of its API.
| Constructor Summary | |
|---|---|
CSVReader(java.io.Reader reader)
Constructs a CSV reader with the default options. |
|
CSVReader(java.io.Reader reader,
char delimiter)
Constructs a CSV reader with the specified options. |
|
CSVReader(java.io.Reader reader,
char delimiter,
char comment)
Constructs a CSV reader with the specified options. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the input |
int |
getLineNumber()
Returns the current line number. |
java.util.List<java.lang.String> |
readLine()
Reads and parses the next CSV line from the input. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVReader(java.io.Reader reader)
reader - input to read from.
public CSVReader(java.io.Reader reader,
char delimiter)
reader - input to read from. A BufferedReader is
recommended for better performance. Note that a
LineNumberReader should not be used since it
will not be able to track the line numbers correctly (newlines
can be escaped in a CSV file).comment - character indicating line is a comment and should be ignored
public CSVReader(java.io.Reader reader,
char delimiter,
char comment)
reader - input to read from. A BufferedReader is
recommended for better performance. Note that a
LineNumberReader should not be used since it
will not be able to track the line numbers correctly (newlines
can be escaped in a CSV file).comment - character indicating line is a comment and should be ignoreddelimiter - field delimiter character| Method Detail |
|---|
public int getLineNumber()
public java.util.List<java.lang.String> readLine()
throws java.io.IOException,
ParseException
java.io.IOException - if an error occurs reading the input
ParseException - if an error occurs during CSV parsing
public void close()
throws java.io.IOException
java.io.IOException - if an I/O error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||