Class CsvDataFormat.Builder

java.lang.Object
org.apache.camel.model.dataformat.CsvDataFormat.Builder
All Implemented Interfaces:
DataFormatBuilder<CsvDataFormat>
Enclosing class:
CsvDataFormat

public static class CsvDataFormat.Builder extends Object implements DataFormatBuilder<CsvDataFormat>
Builder is a specific builder for CsvDataFormat.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • marshallerFactoryRef

      public CsvDataFormat.Builder marshallerFactoryRef(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 - the CsvMarshallerFactory reference.
    • formatRef

      public CsvDataFormat.Builder formatRef(String formatRef)
      The reference format to use, it will be updated with the other format options, the default value is CSVFormat.DEFAULT
    • formatName

      public CsvDataFormat.Builder formatName(String formatName)
      The name of the format to use, the default value is CSVFormat.DEFAULT
    • commentMarkerDisabled

      public CsvDataFormat.Builder commentMarkerDisabled(String commentMarkerDisabled)
      Disables the comment marker of the reference format.
    • commentMarkerDisabled

      public CsvDataFormat.Builder commentMarkerDisabled(boolean commentMarkerDisabled)
      Disables the comment marker of the reference format.
    • commentMarker

      public CsvDataFormat.Builder commentMarker(String commentMarker)
      Sets the comment marker of the reference format.
    • delimiter

      public CsvDataFormat.Builder delimiter(String delimiter)
      Sets the delimiter to use.

      The default value is , (comma)

    • escapeDisabled

      public CsvDataFormat.Builder escapeDisabled(String escapeDisabled)
      Use for disabling using escape character
    • escapeDisabled

      public CsvDataFormat.Builder escapeDisabled(boolean escapeDisabled)
      Use for disabling using escape character
    • escape

      public CsvDataFormat.Builder escape(String escape)
      Sets the escape character to use
    • headerDisabled

      public CsvDataFormat.Builder headerDisabled(String headerDisabled)
    • headerDisabled

      public CsvDataFormat.Builder headerDisabled(boolean headerDisabled)
    • header

      public CsvDataFormat.Builder header(List<String> header)
      To configure the CSV headers
    • allowMissingColumnNames

      public CsvDataFormat.Builder allowMissingColumnNames(String allowMissingColumnNames)
      Whether to allow missing column names.
    • allowMissingColumnNames

      public CsvDataFormat.Builder allowMissingColumnNames(boolean allowMissingColumnNames)
      Whether to allow missing column names.
    • ignoreEmptyLines

      public CsvDataFormat.Builder ignoreEmptyLines(String ignoreEmptyLines)
      Whether to ignore empty lines.
    • ignoreEmptyLines

      public CsvDataFormat.Builder ignoreEmptyLines(boolean ignoreEmptyLines)
      Whether to ignore empty lines.
    • ignoreSurroundingSpaces

      public CsvDataFormat.Builder ignoreSurroundingSpaces(String ignoreSurroundingSpaces)
      Whether to ignore surrounding spaces
    • ignoreSurroundingSpaces

      public CsvDataFormat.Builder ignoreSurroundingSpaces(boolean ignoreSurroundingSpaces)
      Whether to ignore surrounding spaces
    • nullStringDisabled

      public CsvDataFormat.Builder nullStringDisabled(String nullStringDisabled)
      Used to disable null strings
    • nullStringDisabled

      public CsvDataFormat.Builder nullStringDisabled(boolean nullStringDisabled)
      Used to disable null strings
    • nullString

      public CsvDataFormat.Builder nullString(String nullString)
      Sets the null string
    • quoteDisabled

      public CsvDataFormat.Builder quoteDisabled(String quoteDisabled)
      Used to disable quotes
    • quoteDisabled

      public CsvDataFormat.Builder quoteDisabled(boolean quoteDisabled)
      Used to disable quotes
    • quote

      public CsvDataFormat.Builder quote(String quote)
      Sets the quote which by default is "
    • recordSeparatorDisabled

      public CsvDataFormat.Builder recordSeparatorDisabled(String recordSeparatorDisabled)
      Used for disabling record separator
    • recordSeparator

      public CsvDataFormat.Builder recordSeparator(String recordSeparator)
      Sets the record separator (aka new line) which by default is new line characters (CRLF)
    • skipHeaderRecord

      public CsvDataFormat.Builder skipHeaderRecord(String skipHeaderRecord)
      Whether to skip the header record in the output
    • skipHeaderRecord

      public CsvDataFormat.Builder skipHeaderRecord(boolean skipHeaderRecord)
      Whether to skip the header record in the output
    • quoteMode

      public CsvDataFormat.Builder quoteMode(String quoteMode)
      Sets the quote mode
    • lazyLoad

      public CsvDataFormat.Builder lazyLoad(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.
    • lazyLoad

      public CsvDataFormat.Builder lazyLoad(boolean 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.
    • useMaps

      public CsvDataFormat.Builder useMaps(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).
    • useMaps

      public CsvDataFormat.Builder useMaps(boolean useMaps)
      Whether the unmarshalling should produce maps (HashMap)for the lines values instead of lists. It requires to have header (either defined or collected).
    • useOrderedMaps

      public CsvDataFormat.Builder useOrderedMaps(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).
    • useOrderedMaps

      public CsvDataFormat.Builder useOrderedMaps(boolean 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).
    • recordConverterRef

      public CsvDataFormat.Builder recordConverterRef(String recordConverterRef)
      Refers to a custom CsvRecordConverter to lookup from the registry to use.
    • trim

      public CsvDataFormat.Builder trim(String trim)
      Sets whether or not to trim leading and trailing blanks.
    • trim

      public CsvDataFormat.Builder trim(boolean trim)
      Sets whether or not to trim leading and trailing blanks.
    • ignoreHeaderCase

      public CsvDataFormat.Builder ignoreHeaderCase(String ignoreHeaderCase)
      Sets whether or not to ignore case when accessing header names.
    • ignoreHeaderCase

      public CsvDataFormat.Builder ignoreHeaderCase(boolean ignoreHeaderCase)
      Sets whether or not to ignore case when accessing header names.
    • trailingDelimiter

      public CsvDataFormat.Builder trailingDelimiter(String trailingDelimiter)
      Sets whether or not to add a trailing delimiter.
    • trailingDelimiter

      public CsvDataFormat.Builder trailingDelimiter(boolean trailingDelimiter)
      Sets whether or not to add a trailing delimiter.
    • captureHeaderRecord

      public CsvDataFormat.Builder captureHeaderRecord(String captureHeaderRecord)
      Whether the unmarshalling should capture the header record and store it in the message header
    • captureHeaderRecord

      public CsvDataFormat.Builder captureHeaderRecord(boolean captureHeaderRecord)
      Whether the unmarshalling should capture the header record and store it in the message header
    • end

      public CsvDataFormat end()
      Description copied from interface: DataFormatBuilder
      Ends the build of the data format.
      Specified by:
      end in interface DataFormatBuilder<CsvDataFormat>
      Returns:
      the data format fully built.