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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionUse for disabling headersReturns theCsvMarshallerFactory
reference.getQuote()
getTrim()
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
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
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
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
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 Details
-
CsvDataFormat
public CsvDataFormat() -
CsvDataFormat
-
CsvDataFormat
public CsvDataFormat(boolean lazyLoad)
-
-
Method Details
-
setMarshallerFactoryRef
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
Returns theCsvMarshallerFactory
reference.- Returns:
- the
CsvMarshallerFactory
ornull
if none has been specified.
-
getFormatRef
-
setFormatRef
The reference format to use, it will be updated with the other format options, the default value is CSVFormat.DEFAULT -
getFormatName
-
setFormatName
The name of the format to use, the default value is CSVFormat.DEFAULT -
getCommentMarkerDisabled
-
setCommentMarkerDisabled
Disables the comment marker of the reference format. -
getCommentMarker
-
setCommentMarker
Sets the comment marker of the reference format. -
getDelimiter
-
setDelimiter
Sets the delimiter to use. The default value is , (comma) -
getEscapeDisabled
-
setEscapeDisabled
Use for disabling using escape character -
getEscape
-
setEscape
Sets the escape character to use -
getHeaderDisabled
Use for disabling headers -
setHeaderDisabled
-
getHeader
-
setHeader
To configure the CSV headers -
getAllowMissingColumnNames
-
setAllowMissingColumnNames
Whether to allow missing column names. -
getIgnoreEmptyLines
-
setIgnoreEmptyLines
Whether to ignore empty lines. -
getIgnoreSurroundingSpaces
-
setIgnoreSurroundingSpaces
Whether to ignore surrounding spaces -
getNullStringDisabled
-
setNullStringDisabled
Used to disable null strings -
getNullString
-
setNullString
Sets the null string -
getQuoteDisabled
-
setQuoteDisabled
Used to disable quotes -
getQuote
-
setQuote
Sets the quote which by default is " -
getRecordSeparatorDisabled
-
setRecordSeparatorDisabled
Used for disabling record separator -
getRecordSeparator
-
setRecordSeparator
Sets the record separator (aka new line) which by default is new line characters (CRLF) -
getSkipHeaderRecord
-
setSkipHeaderRecord
Whether to skip the header record in the output -
getQuoteMode
-
setQuoteMode
Sets the quote mode -
getLazyLoad
-
setLazyLoad
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
-
setUseMaps
Whether the unmarshalling should produce maps (HashMap)for the lines values instead of lists. It requires to have header (either defined or collected). -
getUseOrderedMaps
-
setUseOrderedMaps
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
-
setRecordConverterRef
Refers to a custom CsvRecordConverter to lookup from the registry to use. -
setTrim
Sets whether or not to trim leading and trailing blanks. -
getTrim
-
setIgnoreHeaderCase
Sets whether or not to ignore case when accessing header names. -
getIgnoreHeaderCase
-
setTrailingDelimiter
Sets whether or not to add a trailing delimiter. -
getTrailingDelimiter
-
getCaptureHeaderRecord
-
setCaptureHeaderRecord
Whether the unmarshalling should capture the header record and store it in the message header
-