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
025     * message containing key-value pairs) must be described in the model, we will
026     * use this annotation. The key pair separator (mandatory) defines the separator
027     * between the key and the value The pair separator (mandatory) allows to define
028     * which character separate the pairs from each other The name is optional and
029     * could be used in the future to bind a property which a different name The
030     * type (optional) allow to define the type of the message (e.g. FIX, EMX, ...)
031     * The version (optional) defines the version of the message (e.g. 4.1, ...) The
032     * crlf (optional) is used to add a new line after a record. By default, the
033     * value is WINDOWS The isOrdered (optional) boolean is used to ordered the
034     * message generated in output (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
056         * (mandatory)
057         * 
058         * @return String
059         */
060        String keyValuePairSeparator();
061    
062        /**
063         * type is used to define the type of the message (e.g. FIX, EMX, ...)
064         * (optional)
065         */
066        String type() default "FIX";
067    
068        /**
069         * version defines the version of the message (e.g. 4.1, ...) (optional)
070         */
071        String version() default "4.1";
072    
073        /**
074         * Character to be used to add a carriage return after each record
075         * (optional) Three values can be used : WINDOWS, UNIX or MAC
076         * 
077         * @return String
078         */
079        String crlf() default "WINDOWS";
080    
081        /**
082         * Indicates if the message must be ordered in output
083         * 
084         * @return boolean
085         */
086        boolean isOrdered() default false;
087    }