public class CSVUtils extends Object
Constructor and Description |
---|
CSVUtils()
CSVUtils instances should NOT be constructed in
standard programming. |
Modifier and Type | Method and Description |
---|---|
static String[][] |
parse(String s)
Parses the given String according to the default
CSVStrategy . |
static String[] |
parseLine(String s)
Parses the first line only according to the default
CSVStrategy . |
static String |
printLine(String[] values,
CSVStrategy strategy)
Converts an array of string values into a single CSV line.
|
public CSVUtils()
CSVUtils
instances should NOT be constructed in
standard programming.
This constructor is public to permit tools that require a JavaBean instance to operate.
public static String printLine(String[] values, CSVStrategy strategy)
null
values are converted to the string "null"
,
all strings equal to "null"
will additionally get quotes
around.values
- the value arraypublic static String[][] parse(String s) throws IOException
CSVStrategy
.s
- CSV String to be parsed.IOException
- in case of errorpublic static String[] parseLine(String s) throws IOException
CSVStrategy
.
Parsing empty string will be handled as valid records containing zero
elements, so the following property holds: parseLine("").length == 0.s
- CSV String to be parsed.IOException
- in case of errorCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.