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    @Metadata(javaType = "java.lang.Boolean")
036    private String quoteAllFields;
037    @XmlAttribute
038    @Metadata(defaultValue = "\"")
039    private String quote;
040    @XmlAttribute
041    @Metadata(defaultValue = "\"")
042    private String quoteEscape;
043    @XmlAttribute
044    @Metadata(defaultValue = ",")
045    private String delimiter;
046
047    public UniVocityCsvDataFormat() {
048        super("univocity-csv");
049    }
050
051    public String getQuoteAllFields() {
052        return quoteAllFields;
053    }
054
055    /**
056     * Whether or not all values must be quoted when writing them.
057     */
058    public void setQuoteAllFields(String quoteAllFields) {
059        this.quoteAllFields = quoteAllFields;
060    }
061
062    public String getQuote() {
063        return quote;
064    }
065
066    /**
067     * The quote symbol.
068     */
069    public void setQuote(String quote) {
070        this.quote = quote;
071    }
072
073    public String getQuoteEscape() {
074        return quoteEscape;
075    }
076
077    /**
078     * The quote escape symbol
079     */
080    public void setQuoteEscape(String quoteEscape) {
081        this.quoteEscape = quoteEscape;
082    }
083
084    public String getDelimiter() {
085        return delimiter;
086    }
087
088    /**
089     * The delimiter of values
090     */
091    public void setDelimiter(String delimiter) {
092        this.delimiter = delimiter;
093    }
094
095}