public class CSVUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String[][] |
EMPTY_DOUBLE_STRING_ARRAY |
private static java.lang.String[] |
EMPTY_STRING_ARRAY |
| Constructor and Description |
|---|
CSVUtils()
CSVUtils instances should NOT be constructed in
standard programming. |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[][] |
parse(java.lang.String s)
Parses the given String according to the default
CSVStrategy. |
static java.lang.String[] |
parseLine(java.lang.String s)
Parses the first line only according to the default
CSVStrategy. |
static java.lang.String |
printLine(java.lang.String[] values,
CSVStrategy strategy)
Converts an array of string values into a single CSV line.
|
private static final java.lang.String[] EMPTY_STRING_ARRAY
private static final java.lang.String[][] EMPTY_DOUBLE_STRING_ARRAY
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 java.lang.String printLine(java.lang.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 java.lang.String[][] parse(java.lang.String s)
throws java.io.IOException
CSVStrategy.s - CSV String to be parsed.java.io.IOException - in case of errorpublic static java.lang.String[] parseLine(java.lang.String s)
throws java.io.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.java.io.IOException - in case of error