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 */
017 package org.apache.camel.dataformat.bindy.annotation;
018
019 import java.lang.annotation.Documented;
020 import java.lang.annotation.Retention;
021 import java.lang.annotation.RetentionPolicy;
022
023 /**
024 * This annotation represents the root class of the model. When a
025 * fixed-length record must be described in the model we will use this
026 * annotation to split the data during the unmarshal process.
027 */
028 @Documented
029 @Retention(RetentionPolicy.RUNTIME)
030 public @interface FixedLengthRecord {
031
032 /**
033 * Name describing the record (optional)
034 *
035 * @return String
036 */
037 String name() default "";
038
039 /**
040 * Character to be used to add a carriage return after each record
041 * (optional) Three values can be used : WINDOWS, UNIX or MAC
042 *
043 * @return String
044 */
045 String crlf() default "WINDOWS";
046
047 /**
048 * The char to pad with.
049 * @return the char to pad with if the record is set to a fixed length;
050 */
051 char paddingChar() default ' ';
052
053 /**
054 * The fixed length of the record. It means that the record will always be that long padded with {#paddingChar()}'s
055 * @return the length of the record.
056 */
057 int length() default 0;
058
059 boolean hasHeader() default false;
060
061 boolean hasFooter() default false;
062
063 }