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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUse for disabling headersReturns theCsvMarshallerFactoryreference.getQuote()getTrim()voidsetAllowMissingColumnNames(String allowMissingColumnNames) Whether to allow missing column names.voidsetCaptureHeaderRecord(String captureHeaderRecord) Whether the unmarshalling should capture the header record and store it in the message headervoidsetCommentMarker(String commentMarker) Sets the comment marker of the reference format.voidsetCommentMarkerDisabled(String commentMarkerDisabled) Disables the comment marker of the reference format.voidsetDelimiter(String delimiter) Sets the delimiter to use.voidSets the escape character to usevoidsetEscapeDisabled(String escapeDisabled) Use for disabling using escape charactervoidsetFormatName(String formatName) The name of the format to use, the default value is CSVFormat.DEFAULTvoidsetFormatRef(String formatRef) The reference format to use, it will be updated with the other format options, the default value is CSVFormat.DEFAULTvoidTo configure the CSV headersvoidsetHeaderDisabled(String headerDisabled) voidsetIgnoreEmptyLines(String ignoreEmptyLines) Whether to ignore empty lines.voidsetIgnoreHeaderCase(String ignoreHeaderCase) Sets whether or not to ignore case when accessing header names.voidsetIgnoreSurroundingSpaces(String ignoreSurroundingSpaces) Whether to ignore surrounding spacesvoidsetLazyLoad(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.voidsetMarshallerFactoryRef(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.voidsetNullString(String nullString) Sets the null stringvoidsetNullStringDisabled(String nullStringDisabled) Used to disable null stringsvoidSets the quote which by default is "voidsetQuoteDisabled(String quoteDisabled) Used to disable quotesvoidsetQuoteMode(String quoteMode) Sets the quote modevoidsetRecordConverterRef(String recordConverterRef) Refers to a custom CsvRecordConverter to lookup from the registry to use.voidsetRecordSeparator(String recordSeparator) Sets the record separator (aka new line) which by default is new line characters (CRLF)voidsetRecordSeparatorDisabled(String recordSeparatorDisabled) Used for disabling record separatorvoidsetSkipHeaderRecord(String skipHeaderRecord) Whether to skip the header record in the outputvoidsetTrailingDelimiter(String trailingDelimiter) Sets whether or not to add a trailing delimiter.voidSets whether or not to trim leading and trailing blanks.voidsetUseMaps(String useMaps) Whether the unmarshalling should produce maps (HashMap)for the lines values instead of lists.voidsetUseOrderedMaps(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, setDataFormatNameMethods 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- theCsvMarshallerFactoryreference.
-
getMarshallerFactoryRef
Returns theCsvMarshallerFactoryreference.- Returns:
- the
CsvMarshallerFactoryornullif 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
-