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 message (FIX message
025     * containing key-value pairs) must be described in the model, we will use this
026     * annotation.
027    
028     * The key pair separator (mandatory) defines the separator between the key and the value
029     * The pair separator (mandatory) allows to define which character separate the pairs from each other
030     * The name is optional and could be used in the future to bind a property which a different name
031     * The type (optional) allow to define the type of the message (e.g. FIX, EMX, ...)
032     * The version (optional) defines the version of the message (e.g. 4.1, ...)
033     * The crlf (optional) is used to add a new line after a record. By default, the value is WINDOWS 
034     * (line feed and carriage return on windows 
035     */
036    @Documented
037    @Retention(RetentionPolicy.RUNTIME)
038    public @interface Message {
039    
040        /**
041         * Name describing the message (optional)
042         * 
043         * @return String
044         */
045        String name() default "";
046    
047        /**
048         * Pair separator used to split the key value pairs in tokens (mandatory)
049         * 
050         * @return String
051         */
052        String pairSeparator();
053        
054        /**
055         * Key value pair separator is used to split the values from their keys (mandatory)
056         * 
057         * @return String
058         */
059        String keyValuePairSeparator();
060        
061        
062        /**
063         * type is used to define the type of the message (e.g. FIX, EMX, ...) (optional)
064         */
065        String type() default "FIX";
066        
067        /**
068         * version defines the version of the message (e.g. 4.1, ...) (optional)
069         */
070        String version() default "4.1";
071        
072        /**
073         * Character to be used to add a carriage return after each record (optional)
074         * Three values can be used : WINDOWS, UNIX or MAC
075         * 
076         * @return String
077         */
078        String crlf() default "WINDOWS";
079    
080    }