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 key value pair field
025 * The tag (mandatory) identifies the key of the key value pair (e.g. 8 equals the begin string in FIX
026 * The name (optional) could be used in the future to bind a property which a different name
027 * The pattern (optional) allows to define the pattern of the data (useful for Date, BigDecimal ...)
028 * The precision (optional) reflects the precision to be used with BigDecimal number
029 * The required (optional) field allows to define if the field is required or not. This property is
030 * not yet used but will be useful in the future with the validation
031 */
032 @Documented
033 @Retention(RetentionPolicy.RUNTIME)
034 public @interface KeyValuePairField {
035
036 /**
037 * tag identifying the field in the message (mandatory)
038 *
039 * @return int
040 */
041 int tag();
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 * precision of the BigDecimal number to be created
059 *
060 * @return int
061 */
062 int precision() default 0;
063
064 boolean required() default false;
065
066 }