public class CsvParserConfiguration extends Object
Constructor and Description |
---|
CsvParserConfiguration()
Constructs a new CsvParserConfiguration.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getComments()
Returns the array of comment prefixes.
|
char |
getDelimiter()
Returns the field delimiter.
|
Character |
getEscape()
Returns the escape character.
|
String |
getLineSeparator()
Deprecated.
|
char |
getQuote()
Returns the character to use for a quotation mark.
|
String |
getRecordTerminator()
Returns the text used to terminate a record.
|
boolean |
isAlwaysQuote()
Returns true if fields should always be quoted when marshalled.
|
boolean |
isCommentEnabled()
Returns whether one or more comment prefixes have been configured.
|
boolean |
isEscapeEnabled()
Returns whether escaping is enabled.
|
boolean |
isMultilineEnabled()
Returns whether a record may span multiple lines (when quoted).
|
boolean |
isUnquotedQuotesAllowed()
Returns whether quotes are allowed to appear in an unquoted field.
|
boolean |
isWhitespaceAllowed()
Returns whether to ignore unquoted whitespace.
|
void |
setAlwaysQuote(boolean alwaysQuote)
Set to true to quote every field when marshalled.
|
void |
setComments(String[] comments)
Sets the array of comment prefixes.
|
void |
setDelimiter(char c)
Sets the field delimiter.
|
void |
setEscape(Character c)
Sets the escape character.
|
void |
setLineSeparator(String lineSeparator)
Deprecated.
|
void |
setMultilineEnabled(boolean multilineEnabled)
Sets whether a record may span multiple lines (when quoted).
|
void |
setQuote(char quote)
Sets the character to use for a quotation mark.
|
void |
setRecordTerminator(String recordTerminator)
Sets the text used to terminate a record.
|
void |
setUnquotedQuotesAllowed(boolean unquotedQuotesAllowed)
Sets whether quotes are allowed to appear in an unquoted field.
|
void |
setWhitespaceAllowed(boolean whitespaceAllowed)
Sets whether unquoted whitespace is ignored.
|
public CsvParserConfiguration()
public void setDelimiter(char c)
c
- the character used to delimit fieldspublic char getDelimiter()
public char getQuote()
public void setQuote(char quote)
quote
- the new quotation mark characterpublic void setEscape(Character c)
c
- new escape characterpublic Character getEscape()
public boolean isEscapeEnabled()
getEscape()
public boolean isMultilineEnabled()
public void setMultilineEnabled(boolean multilineEnabled)
multilineEnabled
- set to true true to allow records to
span multiple linespublic boolean isWhitespaceAllowed()
"Field1", "Field2" ^ Unquoted whitespace here
public void setWhitespaceAllowed(boolean whitespaceAllowed)
whitespaceAllowed
- set to true to ignore unquoted
whitespacepublic boolean isUnquotedQuotesAllowed()
Field1,Field"2,Field3
public void setUnquotedQuotesAllowed(boolean unquotedQuotesAllowed)
unquotedQuotesAllowed
- set to true if quotes may appear in
an unquoted fieldpublic String[] getComments()
public void setComments(String[] comments)
comments
- the array of comment prefixespublic boolean isCommentEnabled()
public boolean isAlwaysQuote()
public void setAlwaysQuote(boolean alwaysQuote)
alwaysQuote
- set to true to quote every field regardless
of contentpublic String getRecordTerminator()
public void setRecordTerminator(String recordTerminator)
recordTerminator
- the record termination textpublic String getLineSeparator()
public void setLineSeparator(String lineSeparator)
lineSeparator
- the line separation text