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