001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.model.dataformat;
018
019import javax.xml.bind.annotation.XmlAccessType;
020import javax.xml.bind.annotation.XmlAccessorType;
021import javax.xml.bind.annotation.XmlAttribute;
022import javax.xml.bind.annotation.XmlRootElement;
023
024import org.apache.camel.spi.Metadata;
025
026/**
027 * The uniVocity CSV data format is used for working with CSV (Comma Separated
028 * Values) flat payloads.
029 */
030@Metadata(firstVersion = "2.15.0", label = "dataformat,transformation,csv", title = "uniVocity CSV")
031@XmlRootElement(name = "univocity-csv")
032@XmlAccessorType(XmlAccessType.FIELD)
033public class UniVocityCsvDataFormat extends UniVocityAbstractDataFormat {
034    @XmlAttribute
035    private Boolean quoteAllFields;
036    @XmlAttribute
037    @Metadata(defaultValue = "\"")
038    private String quote;
039    @XmlAttribute
040    @Metadata(defaultValue = "\"")
041    private String quoteEscape;
042    @XmlAttribute
043    @Metadata(defaultValue = ",")
044    private String delimiter;
045
046    public UniVocityCsvDataFormat() {
047        super("univocity-csv");
048    }
049
050    public Boolean getQuoteAllFields() {
051        return quoteAllFields;
052    }
053
054    /**
055     * Whether or not all values must be quoted when writing them.
056     */
057    public void setQuoteAllFields(Boolean quoteAllFields) {
058        this.quoteAllFields = quoteAllFields;
059    }
060
061    public String getQuote() {
062        return quote;
063    }
064
065    /**
066     * The quote symbol.
067     */
068    public void setQuote(String quote) {
069        this.quote = quote;
070    }
071
072    public String getQuoteEscape() {
073        return quoteEscape;
074    }
075
076    /**
077     * The quote escape symbol
078     */
079    public void setQuoteEscape(String quoteEscape) {
080        this.quoteEscape = quoteEscape;
081    }
082
083    public String getDelimiter() {
084        return delimiter;
085    }
086
087    /**
088     * The delimiter of values
089     */
090    public void setDelimiter(String delimiter) {
091        this.delimiter = delimiter;
092    }
093
094}