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 Fixed Length data format is used for working with fixed length
028 * flat payloads.
029 */
030@Metadata(firstVersion = "2.15.0", label = "dataformat,transformation,csv", title = "uniVocity Fixed Length")
031@XmlRootElement(name = "univocity-fixed")
032@XmlAccessorType(XmlAccessType.FIELD)
033public class UniVocityFixedWidthDataFormat extends UniVocityAbstractDataFormat {
034    @XmlAttribute
035    private Boolean skipTrailingCharsUntilNewline;
036    @XmlAttribute
037    private Boolean recordEndsOnNewline;
038    @XmlAttribute
039    private String padding;
040
041    public UniVocityFixedWidthDataFormat() {
042        super("univocity-fixed");
043    }
044
045    public Boolean getSkipTrailingCharsUntilNewline() {
046        return skipTrailingCharsUntilNewline;
047    }
048
049    /**
050     * Whether or not the trailing characters until new line must be ignored.
051     * <p/>
052     * The default value is false
053     */
054    public void setSkipTrailingCharsUntilNewline(Boolean skipTrailingCharsUntilNewline) {
055        this.skipTrailingCharsUntilNewline = skipTrailingCharsUntilNewline;
056    }
057
058    public Boolean getRecordEndsOnNewline() {
059        return recordEndsOnNewline;
060    }
061
062    /**
063     * Whether or not the record ends on new line.
064     * <p/>
065     * The default value is false
066     */
067    public void setRecordEndsOnNewline(Boolean recordEndsOnNewline) {
068        this.recordEndsOnNewline = recordEndsOnNewline;
069    }
070
071    public String getPadding() {
072        return padding;
073    }
074
075    /**
076     * The padding character.
077     * <p/>
078     * The default value is a space
079     */
080    public void setPadding(String padding) {
081        this.padding = padding;
082    }
083
084}