|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.Format
com.univocity.parsers.csv.CsvFormat
public class CsvFormat
The CSV format configuration. In addition to the default configuration in 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| Constructor Summary | |
|---|---|
CsvFormat()
|
|
| Method Summary | |
|---|---|
CsvFormat |
clone()
|
char |
getCharToEscapeQuoteEscaping()
Returns the character used to escape the character used for escaping quotes defined by getQuoteEscape(). |
protected TreeMap<String,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. |
| Methods inherited from class com.univocity.parsers.common.Format |
|---|
getComment, getLineSeparator, getLineSeparatorString, getNormalizedNewline, getSystemLineSeparator, isComment, isNewLine, setComment, setLineSeparator, setLineSeparator, setNormalizedNewline, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CsvFormat()
| Method Detail |
|---|
public char getQuote()
public void setQuote(char quote)
quote - the quote characterpublic boolean isQuote(char ch)
ch - the character to be verified
public char getQuoteEscape()
public void setQuoteEscape(char quoteEscape)
quoteEscape - the quote escape characterpublic boolean isQuoteEscape(char ch)
ch - the character to be verified
public char getDelimiter()
public void setDelimiter(char delimiter)
delimiter - the field delimiter characterpublic boolean isDelimiter(char ch)
ch - the character to be verified
public 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 verified
protected TreeMap<String,Object> getConfiguration()
getConfiguration in class Formatpublic final CsvFormat clone()
clone in class Format
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||