public class CsvFormat extends Format
Format
, the CSV format defines:
e.g. the value a , b is parsed as [ a ][ b ]
e.g. the value " a , b " is parsed as [ a , b ] (instead of [ a ][ b ]
e.g. the value " "" a , b "" " is parsed as [ " a , b " ] (instead of [ " a ][ b " ] or [ "" a , b "" ])
e.g. if the quoteEscape and charToEscapeQuoteEscaping are set to '\', the value " \\\" a , b \\\" " is parsed as [ \" a , b \" ]
Format
Modifier and Type | Field and Description |
---|---|
private java.lang.Character |
charToEscapeQuoteEscaping |
private char |
delimiter |
private char |
quote |
private char |
quoteEscape |
Constructor and Description |
---|
CsvFormat() |
Modifier and Type | Method and Description |
---|---|
CsvFormat |
clone() |
char |
getCharToEscapeQuoteEscaping()
Returns the character used to escape the character used for escaping quotes defined by
getQuoteEscape() . |
protected java.util.TreeMap<java.lang.String,java.lang.Object> |
getConfiguration() |
char |
getDelimiter()
Returns the field delimiter character.
|
char |
getQuote()
Returns the character used for escaping values where the field delimiter is part of the value.
|
char |
getQuoteEscape()
Returns the character used for escaping quotes inside an already quoted value.
|
boolean |
isCharToEscapeQuoteEscaping(char ch)
Identifies whether or not a given character is used to escape the character used for escaping quotes defined by
getQuoteEscape() . |
boolean |
isDelimiter(char ch)
Identifies whether or not a given character represents a field delimiter
|
boolean |
isQuote(char ch)
Identifies whether or not a given character is used for escaping values where the field delimiter is part of the value
|
boolean |
isQuoteEscape(char ch)
Identifies whether or not a given character is used for escaping quotes inside an already quoted value.
|
void |
setCharToEscapeQuoteEscaping(char charToEscapeQuoteEscaping)
Defines the character used to escape the character used for escaping quotes defined by
getQuoteEscape() . |
void |
setDelimiter(char delimiter)
Defines the field delimiter character.
|
void |
setQuote(char quote)
Defines the character used for escaping values where the field delimiter is part of the value.
|
void |
setQuoteEscape(char quoteEscape)
Defines the character used for escaping quotes inside an already quoted value.
|
getComment, getLineSeparator, getLineSeparatorString, getNormalizedNewline, getSystemLineSeparator, isComment, isNewLine, setComment, setLineSeparator, setLineSeparator, setNormalizedNewline, toString
private char quote
private char quoteEscape
private char delimiter
private java.lang.Character charToEscapeQuoteEscaping
public char getQuote()
public void setQuote(char quote)
quote
- the quote characterpublic boolean isQuote(char ch)
ch
- the character to be verifiedpublic char getQuoteEscape()
public void setQuoteEscape(char quoteEscape)
quoteEscape
- the quote escape characterpublic boolean isQuoteEscape(char ch)
ch
- the character to be verifiedpublic char getDelimiter()
public void setDelimiter(char delimiter)
delimiter
- the field delimiter characterpublic boolean isDelimiter(char ch)
ch
- the character to be verifiedpublic final char getCharToEscapeQuoteEscaping()
getQuoteEscape()
.
For example, if the quote escape is set to '\', and the quoted value ends with: \", as in the following example:
[ " a\\", b ]
Then:public final void setCharToEscapeQuoteEscaping(char charToEscapeQuoteEscaping)
getQuoteEscape()
.
For example, if the quote escape is set to '\', and the quoted value ends with: \", as in the following example:
[ " a\\", b ]
Then:charToEscapeQuoteEscaping
- the character to escape the character used for escaping quotes definedpublic final boolean isCharToEscapeQuoteEscaping(char ch)
getQuoteEscape()
.ch
- the character to be verifiedprotected java.util.TreeMap<java.lang.String,java.lang.Object> getConfiguration()
getConfiguration
in class Format