Class UniVocityCsvDataFormat

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @Dataformat("univocity-csv")
    public class UniVocityCsvDataFormat
    extends AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
    This class is the data format that uses the CSV uniVocity parser.
    • Constructor Detail

      • UniVocityCsvDataFormat

        public UniVocityCsvDataFormat()
    • Method Detail

      • getQuoteAllFields

        public Boolean getQuoteAllFields()
        Gets whether or not all fields must be quoted. If null then the default settings value is used.
        Returns:
        whether or not all fields must be quoted
        See Also:
        CsvWriterSettings.getQuoteAllFields()
      • setQuoteAllFields

        public UniVocityCsvDataFormat setQuoteAllFields​(Boolean quoteAllFields)
        Gets whether or not all fields must be quoted. If null then the default settings value is used.
        Parameters:
        quoteAllFields - whether or not all fields must be quoted
        Returns:
        current data format instance, fluent API
        See Also:
        CsvWriterSettings.setQuoteAllFields(boolean)
      • getQuote

        public Character getQuote()
        Gets the quote symbol. If null then the default format value is used.
        Returns:
        the quote symbol
        See Also:
        CsvFormat.getQuote()
      • setQuote

        public UniVocityCsvDataFormat setQuote​(Character quote)
        Sets the quote symbol. If null then the default format value is used.
        Parameters:
        quote - the quote symbol
        Returns:
        current data format instance, fluent API
        See Also:
        CsvFormat.setQuote(char)
      • getQuoteEscape

        public Character getQuoteEscape()
        Gets the quote escape symbol. If null then the default format value is used.
        Returns:
        the quote escape symbol
        See Also:
        CsvFormat.getQuoteEscape()
      • setQuoteEscape

        public UniVocityCsvDataFormat setQuoteEscape​(Character quoteEscape)
        Sets the quote escape symbol. If null then the default format value is used.
        Parameters:
        quoteEscape - the quote escape symbol
        Returns:
        current data format instance, fluent API
        See Also:
        CsvFormat.setQuoteEscape(char)
      • getDelimiter

        public Character getDelimiter()
        Gets the delimiter symbol. If null then the default format value is used.
        Returns:
        the delimiter symbol
        See Also:
        CsvFormat.getDelimiter()
      • setDelimiter

        public UniVocityCsvDataFormat setDelimiter​(Character delimiter)
        Sets the delimiter symbol. If null then the default format value is used.
        Parameters:
        delimiter - the delimiter symbol
        Returns:
        current data format instance, fluent API
        See Also:
        CsvFormat.setDelimiter(char)
      • createWriterSettings

        protected com.univocity.parsers.csv.CsvWriterSettings createWriterSettings()
        Creates a new instance of the writer settings.
        Specified by:
        createWriterSettings in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Returns:
        New instance of the writer settings
      • configureWriterSettings

        protected void configureWriterSettings​(com.univocity.parsers.csv.CsvWriterSettings settings)
        Configures the writer settings.
        Overrides:
        configureWriterSettings in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Parameters:
        settings - Writer settings to configure
      • createWriter

        protected com.univocity.parsers.csv.CsvWriter createWriter​(Writer writer,
                                                                   com.univocity.parsers.csv.CsvWriterSettings settings)
        Creates a new instance of the uniVocity writer.
        Specified by:
        createWriter in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Parameters:
        writer - Output writer to use
        settings - Writer settings to use
        Returns:
        New uinstance of the uniVocity writer
      • createParserSettings

        protected com.univocity.parsers.csv.CsvParserSettings createParserSettings()
        Creates a new instance of the parser settings.
        Specified by:
        createParserSettings in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Returns:
        New instance of the parser settings
      • configureParserSettings

        protected void configureParserSettings​(com.univocity.parsers.csv.CsvParserSettings settings)
        Configure the parser settings.
        Overrides:
        configureParserSettings in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Parameters:
        settings - Parser settings to configure
      • createParser

        protected com.univocity.parsers.csv.CsvParser createParser​(com.univocity.parsers.csv.CsvParserSettings settings)
        Creates a new instance of the uniVocity parser.
        Specified by:
        createParser in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Parameters:
        settings - Parser settings to use
        Returns:
        New instance of the uniVocity parser
      • configureFormat

        protected void configureFormat​(com.univocity.parsers.csv.CsvFormat format)
        Configures the format.
        Overrides:
        configureFormat in class AbstractUniVocityDataFormat<com.univocity.parsers.csv.CsvFormat,​com.univocity.parsers.csv.CsvWriterSettings,​com.univocity.parsers.csv.CsvWriter,​com.univocity.parsers.csv.CsvParserSettings,​com.univocity.parsers.csv.CsvParser,​UniVocityCsvDataFormat>
        Parameters:
        format - format to configure
      • getDataFormatName

        public String getDataFormatName()