Class CsvDataFormat
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.DataFormatDefinition
-
- org.apache.camel.model.dataformat.CsvDataFormat
-
@Metadata(firstVersion="1.3.0", label="dataformat,transformation,csv", title="CSV") public class CsvDataFormat extends DataFormatDefinition
Handle CSV (Comma Separated Values) payloads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CsvDataFormat.Builder
Builder
is a specific builder forCsvDataFormat
.
-
Constructor Summary
Constructors Constructor Description CsvDataFormat()
CsvDataFormat(boolean lazyLoad)
CsvDataFormat(String delimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAllowMissingColumnNames()
String
getCaptureHeaderRecord()
String
getCommentMarker()
String
getCommentMarkerDisabled()
String
getDelimiter()
String
getEscape()
String
getEscapeDisabled()
String
getFormatName()
String
getFormatRef()
List<String>
getHeader()
String
getHeaderDisabled()
Use for disabling headersString
getIgnoreEmptyLines()
String
getIgnoreHeaderCase()
String
getIgnoreSurroundingSpaces()
String
getLazyLoad()
String
getMarshallerFactoryRef()
Returns theCsvMarshallerFactory
reference.String
getNullString()
String
getNullStringDisabled()
String
getQuote()
String
getQuoteDisabled()
String
getQuoteMode()
String
getRecordConverterRef()
String
getRecordSeparator()
String
getRecordSeparatorDisabled()
String
getSkipHeaderRecord()
String
getTrailingDelimiter()
String
getTrim()
String
getUseMaps()
String
getUseOrderedMaps()
void
setAllowMissingColumnNames(String allowMissingColumnNames)
Whether to allow missing column names.void
setCaptureHeaderRecord(String captureHeaderRecord)
Whether the unmarshalling should capture the header record and store it in the message headervoid
setCommentMarker(String commentMarker)
Sets the comment marker of the reference format.void
setCommentMarkerDisabled(String commentMarkerDisabled)
Disables the comment marker of the reference format.void
setDelimiter(String delimiter)
Sets the delimiter to use.void
setEscape(String escape)
Sets the escape character to usevoid
setEscapeDisabled(String escapeDisabled)
Use for disabling using escape charactervoid
setFormatName(String formatName)
The name of the format to use, the default value is CSVFormat.DEFAULTvoid
setFormatRef(String formatRef)
The reference format to use, it will be updated with the other format options, the default value is CSVFormat.DEFAULTvoid
setHeader(List<String> header)
To configure the CSV headersvoid
setHeaderDisabled(String headerDisabled)
void
setIgnoreEmptyLines(String ignoreEmptyLines)
Whether to ignore empty lines.void
setIgnoreHeaderCase(String ignoreHeaderCase)
Sets whether or not to ignore case when accessing header names.void
setIgnoreSurroundingSpaces(String ignoreSurroundingSpaces)
Whether to ignore surrounding spacesvoid
setLazyLoad(String lazyLoad)
Whether the unmarshalling should produce an iterator that reads the lines on the fly or if all the lines must be read at one.void
setMarshallerFactoryRef(String marshallerFactoryRef)
Sets the implementation of the CsvMarshallerFactory interface which is able to customize marshalling/unmarshalling behavior by extending CsvMarshaller or creating it from scratch.void
setNullString(String nullString)
Sets the null stringvoid
setNullStringDisabled(String nullStringDisabled)
Used to disable null stringsvoid
setQuote(String quote)
Sets the quote which by default is "void
setQuoteDisabled(String quoteDisabled)
Used to disable quotesvoid
setQuoteMode(String quoteMode)
Sets the quote modevoid
setRecordConverterRef(String recordConverterRef)
Refers to a custom CsvRecordConverter to lookup from the registry to use.void
setRecordSeparator(String recordSeparator)
Sets the record separator (aka new line) which by default is new line characters (CRLF)void
setRecordSeparatorDisabled(String recordSeparatorDisabled)
Used for disabling record separatorvoid
setSkipHeaderRecord(String skipHeaderRecord)
Whether to skip the header record in the outputvoid
setTrailingDelimiter(String trailingDelimiter)
Sets whether or not to add a trailing delimiter.void
setTrim(String trim)
Sets whether or not to trim leading and trailing blanks.void
setUseMaps(String useMaps)
Whether the unmarshalling should produce maps (HashMap)for the lines values instead of lists.void
setUseOrderedMaps(String useOrderedMaps)
Whether the unmarshalling should produce ordered maps (LinkedHashMap) for the lines values instead of lists.-
Methods inherited from class org.apache.camel.model.DataFormatDefinition
getDataFormat, getDataFormatName, getShortName, setDataFormat, setDataFormatName
-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Constructor Detail
-
CsvDataFormat
public CsvDataFormat()
-
CsvDataFormat
public CsvDataFormat(String delimiter)
-
CsvDataFormat
public CsvDataFormat(boolean lazyLoad)
-
-
Method Detail
-
setMarshallerFactoryRef
public void setMarshallerFactoryRef(String marshallerFactoryRef)
Sets the implementation of the CsvMarshallerFactory interface which is able to customize marshalling/unmarshalling behavior by extending CsvMarshaller or creating it from scratch.- Parameters:
marshallerFactoryRef
- theCsvMarshallerFactory
reference.
-
getMarshallerFactoryRef
public String getMarshallerFactoryRef()
Returns theCsvMarshallerFactory
reference.- Returns:
- the
CsvMarshallerFactory
ornull
if none has been specified.
-
getFormatRef
public String getFormatRef()
-
setFormatRef
public void setFormatRef(String formatRef)
The reference format to use, it will be updated with the other format options, the default value is CSVFormat.DEFAULT
-
getFormatName
public String getFormatName()
-
setFormatName
public void setFormatName(String formatName)
The name of the format to use, the default value is CSVFormat.DEFAULT
-
getCommentMarkerDisabled
public String getCommentMarkerDisabled()
-
setCommentMarkerDisabled
public void setCommentMarkerDisabled(String commentMarkerDisabled)
Disables the comment marker of the reference format.
-
getCommentMarker
public String getCommentMarker()
-
setCommentMarker
public void setCommentMarker(String commentMarker)
Sets the comment marker of the reference format.
-
getDelimiter
public String getDelimiter()
-
setDelimiter
public void setDelimiter(String delimiter)
Sets the delimiter to use. The default value is , (comma)
-
getEscapeDisabled
public String getEscapeDisabled()
-
setEscapeDisabled
public void setEscapeDisabled(String escapeDisabled)
Use for disabling using escape character
-
getEscape
public String getEscape()
-
setEscape
public void setEscape(String escape)
Sets the escape character to use
-
getHeaderDisabled
public String getHeaderDisabled()
Use for disabling headers
-
setHeaderDisabled
public void setHeaderDisabled(String headerDisabled)
-
getAllowMissingColumnNames
public String getAllowMissingColumnNames()
-
setAllowMissingColumnNames
public void setAllowMissingColumnNames(String allowMissingColumnNames)
Whether to allow missing column names.
-
getIgnoreEmptyLines
public String getIgnoreEmptyLines()
-
setIgnoreEmptyLines
public void setIgnoreEmptyLines(String ignoreEmptyLines)
Whether to ignore empty lines.
-
getIgnoreSurroundingSpaces
public String getIgnoreSurroundingSpaces()
-
setIgnoreSurroundingSpaces
public void setIgnoreSurroundingSpaces(String ignoreSurroundingSpaces)
Whether to ignore surrounding spaces
-
getNullStringDisabled
public String getNullStringDisabled()
-
setNullStringDisabled
public void setNullStringDisabled(String nullStringDisabled)
Used to disable null strings
-
getNullString
public String getNullString()
-
setNullString
public void setNullString(String nullString)
Sets the null string
-
getQuoteDisabled
public String getQuoteDisabled()
-
setQuoteDisabled
public void setQuoteDisabled(String quoteDisabled)
Used to disable quotes
-
getQuote
public String getQuote()
-
setQuote
public void setQuote(String quote)
Sets the quote which by default is "
-
getRecordSeparatorDisabled
public String getRecordSeparatorDisabled()
-
setRecordSeparatorDisabled
public void setRecordSeparatorDisabled(String recordSeparatorDisabled)
Used for disabling record separator
-
getRecordSeparator
public String getRecordSeparator()
-
setRecordSeparator
public void setRecordSeparator(String recordSeparator)
Sets the record separator (aka new line) which by default is new line characters (CRLF)
-
getSkipHeaderRecord
public String getSkipHeaderRecord()
-
setSkipHeaderRecord
public void setSkipHeaderRecord(String skipHeaderRecord)
Whether to skip the header record in the output
-
getQuoteMode
public String getQuoteMode()
-
setQuoteMode
public void setQuoteMode(String quoteMode)
Sets the quote mode
-
getLazyLoad
public String getLazyLoad()
-
setLazyLoad
public void setLazyLoad(String lazyLoad)
Whether the unmarshalling should produce an iterator that reads the lines on the fly or if all the lines must be read at one.
-
getUseMaps
public String getUseMaps()
-
setUseMaps
public void setUseMaps(String useMaps)
Whether the unmarshalling should produce maps (HashMap)for the lines values instead of lists. It requires to have header (either defined or collected).
-
getUseOrderedMaps
public String getUseOrderedMaps()
-
setUseOrderedMaps
public void setUseOrderedMaps(String useOrderedMaps)
Whether the unmarshalling should produce ordered maps (LinkedHashMap) for the lines values instead of lists. It requires to have header (either defined or collected).
-
getRecordConverterRef
public String getRecordConverterRef()
-
setRecordConverterRef
public void setRecordConverterRef(String recordConverterRef)
Refers to a custom CsvRecordConverter to lookup from the registry to use.
-
setTrim
public void setTrim(String trim)
Sets whether or not to trim leading and trailing blanks.
-
getTrim
public String getTrim()
-
setIgnoreHeaderCase
public void setIgnoreHeaderCase(String ignoreHeaderCase)
Sets whether or not to ignore case when accessing header names.
-
getIgnoreHeaderCase
public String getIgnoreHeaderCase()
-
setTrailingDelimiter
public void setTrailingDelimiter(String trailingDelimiter)
Sets whether or not to add a trailing delimiter.
-
getTrailingDelimiter
public String getTrailingDelimiter()
-
getCaptureHeaderRecord
public String getCaptureHeaderRecord()
-
setCaptureHeaderRecord
public void setCaptureHeaderRecord(String captureHeaderRecord)
Whether the unmarshalling should capture the header record and store it in the message header
-
-