org.jfree.report.util
Class CSVQuoter
java.lang.Object
org.jfree.report.util.CSVQuoter
The CSVQuoter
is a helper class to encode a string for the CSV file
format.
CSVQuoter() - Creates a new CSVQuoter, which uses a comma as the default separator.
|
CSVQuoter(char separator) - Creates a new
CSVQuoter , which uses the defined separator.
|
CSVQuoter(char separator, char quate) - Creates a new CSVQuoter with the given separator and quoting character.
|
String | doQuoting(String original) - Encodes the string, so that the string can safely be used in CSV files.
|
char | getQuate() - Returns the quoting character.
|
char | getSeparator() - Gets the separator used in this quoter and the CSV file.
|
String | undoQuoting(String nativeString) - Decodes the string, so that all escape sequences get removed.
|
CSVQuoter
public CSVQuoter()
Creates a new CSVQuoter, which uses a comma as the default separator.
CSVQuoter
public CSVQuoter(char separator)
Creates a new CSVQuoter
, which uses the defined separator.
separator
- the separator.
CSVQuoter
public CSVQuoter(char separator,
char quate)
Creates a new CSVQuoter with the given separator and quoting character.
separator
- the separatorquate
- the quoting character
doQuoting
public String doQuoting(String original)
Encodes the string, so that the string can safely be used in CSV files. If the string
does not need quoting, the original string is returned unchanged.
original
- the unquoted string.
getQuate
public char getQuate()
Returns the quoting character.
getSeparator
public char getSeparator()
Gets the separator used in this quoter and the CSV file.
- the separator (never
null
).
undoQuoting
public String undoQuoting(String nativeString)
Decodes the string, so that all escape sequences get removed. If the string was not
quoted, then the string is returned unchanged.
nativeString
- the quoted string.