public class CustomFormatBuilder extends java.lang.Object implements FormatBuilder
FormatBuilder
that allows for custom csv formats.In the adapter configuration file this class is aliased as csv-custom-format which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
CustomFormatBuilder() |
Modifier and Type | Method and Description |
---|---|
protected static org.apache.commons.csv.CSVFormat |
configureCSV(org.apache.commons.csv.CSVFormat obj,
java.lang.String[] candidates,
java.lang.Class type,
java.lang.String optionName,
java.lang.Object value) |
org.apache.commons.csv.CSVFormat |
createFormat()
Create the CSVFormat.
|
java.lang.Character |
getCommentStart() |
java.lang.Character |
getDelimiter() |
java.lang.Character |
getEscape() |
java.lang.Boolean |
getIgnoreEmptyLines() |
java.lang.Boolean |
getIgnoreSurroundingSpaces() |
java.lang.Character |
getQuoteChar() |
java.lang.String |
getRecordSeparator() |
void |
setCommentStart(java.lang.Character commentStart) |
void |
setDelimiter(java.lang.Character d)
Set the delimiter for the CSV file.
|
void |
setEscape(java.lang.Character escape) |
void |
setIgnoreEmptyLines(java.lang.Boolean b)
Specify whether or not to ignore empty lines.
|
void |
setIgnoreSurroundingSpaces(java.lang.Boolean b)
Specify whether or not to ignore surrounding spaces.
|
void |
setQuoteChar(java.lang.Character quoteChar) |
void |
setRecordSeparator(java.lang.String sep)
Set the record separactor
|
public org.apache.commons.csv.CSVFormat createFormat()
FormatBuilder
createFormat
in interface FormatBuilder
public java.lang.Character getDelimiter()
public void setDelimiter(java.lang.Character d)
d
- the delimiter; if not specified, defaults to ","public java.lang.Character getCommentStart()
public void setCommentStart(java.lang.Character commentStart)
public java.lang.Character getEscape()
public void setEscape(java.lang.Character escape)
public java.lang.Character getQuoteChar()
public void setQuoteChar(java.lang.Character quoteChar)
public java.lang.Boolean getIgnoreEmptyLines()
public void setIgnoreEmptyLines(java.lang.Boolean b)
b
- true or false, if not specified false.public java.lang.Boolean getIgnoreSurroundingSpaces()
public void setIgnoreSurroundingSpaces(java.lang.Boolean b)
b
- true or false, if not specified false.public java.lang.String getRecordSeparator()
public void setRecordSeparator(java.lang.String sep)
sep
- the record separator; if not specified defaults to "\r\n"protected static org.apache.commons.csv.CSVFormat configureCSV(org.apache.commons.csv.CSVFormat obj, java.lang.String[] candidates, java.lang.Class type, java.lang.String optionName, java.lang.Object value)