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     * An annotation used to identify in a POJO which property is link to a field of
025     * a record (csv, ...).
026     * The position (mandatory) identifies the position of the data in the record
027     * The name is optional and could be used in the future to bind a property which a different name
028     * The pattern (optional) allows to define the pattern of the data (useful for Date, ...)
029     * The length (optional) allows to define for fixed length message the size of the data's block
030     * The precision(optional) reflects the precision to be used with BigDecimal number
031     */
032    @Documented
033    @Retention(RetentionPolicy.RUNTIME)
034    public @interface DataField {
035    
036        /**
037         * position of the data in the record (mandatory)
038         * 
039         * @return int
040         */
041        int pos();
042    
043        /**
044         * name of the field (optional)
045         * 
046         * @return String
047         */
048        String name() default "";
049    
050        /**
051         * pattern that the formater will use to transform the data (optional)
052         * 
053         * @return String
054         */
055        String pattern() default "";
056    
057        /**
058         * length of the data block (useful for the fixedlength record) (optional in
059         * this version)
060         * 
061         * @return int
062         */
063        int length() default 0;
064    
065        /**
066         * precision of the BigDecimal number to be created
067         * 
068         * @return int
069         */
070        int precision() default 0;
071    
072    }