|
|||||||||
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.CSVParser
public class CSVParser
Parses CSV lines of text. Options are available to choose the
Notes: Line with trailing comma will result in an empty string field
Attempts to follow this suggestion from RFC4180: Implementors should
"be conservative in what you do, be liberal in what you accept from others"
(RFC 793) when processing CSV files.
Constructor Summary | |
---|---|
CSVParser()
Constructor with default delimiter (,) and trimFields (true). |
|
CSVParser(char delimiter)
|
|
CSVParser(char delimiter,
boolean trimFields)
Constructs the parser with specified options |
Method Summary | |
---|---|
java.lang.String[] |
parse(java.lang.String line)
|
java.util.List<java.lang.String> |
tokenize(java.lang.String line)
Assumes this is one line of CSV text |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVParser()
public CSVParser(char delimiter)
public CSVParser(char delimiter, boolean trimFields)
delimiter
- field separator character (e.g. comma, tab, vertical bar /
pipe, space)trimFields
- indicates if fields are to be trimmed or notMethod Detail |
---|
public java.lang.String[] parse(java.lang.String line) throws ParseException
ParseException
public java.util.List<java.lang.String> tokenize(java.lang.String line) throws ParseException
line
- line of text to parse
ParseException
- if
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |