public class CSVQuoter extends Object
CSVQuoter
is a helper class to encode a string for the CSV file format.Constructor and Description |
---|
CSVQuoter()
Creates a new CSVQuoter, which uses a comma as the default separator.
|
CSVQuoter(String separator)
Creates a new
CSVQuoter , which uses the defined separator. |
Modifier and Type | Method and Description |
---|---|
String |
doQuoting(String original)
Encodes the string, so that the string can safely be used in CSV files.
|
String |
getSeparator()
Gets the separator used in this quoter and the CSV file.
|
void |
setSeparator(String separator)
Defines the separator, which is used in the CSV file.
|
String |
undoQuoting(String nativeString)
Decodes the string, so that all escape sequences get removed.
|
public CSVQuoter()
public CSVQuoter(String separator)
CSVQuoter
, which uses the defined separator.separator
- the separator.NullPointerException
- if the given separator is null
.public String doQuoting(String original)
original
- the unquoted string.public String undoQuoting(String nativeString)
nativeString
- the quoted string.public String getSeparator()
null
).public void setSeparator(String separator)
separator
- the separator (null
not permitted).Copyright © 2002–2017 Pentaho Corporation. All rights reserved.