camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r748118 - in /camel/trunk/components/camel-bindy/src: main/java/org/apache/camel/dataformat/bindy/ main/java/org/apache/camel/dataformat/bindy/annotation/ main/java/org/apache/camel/dataformat/bindy/csv/ main/java/org/apache/camel/dataforma...
Date Thu, 26 Feb 2009 12:44:03 GMT
Author: ningjiang
Date: Thu Feb 26 12:44:02 2009
New Revision: 748118

URL: http://svn.apache.org/viewvc?rev=748118&view=rev
Log:
CAMEL-1364 Applied patch with thanks to Charles

Added:
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java   (with props)
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java   (with props)
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java   (with props)
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java   (with props)
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java   (with props)
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java   (with props)
    camel/trunk/components/camel-bindy/src/test/data/fix/
    camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt   (with props)
    camel/trunk/components/camel-bindy/src/test/data/fix_tab/
    camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java   (with props)
    camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java   (with props)
Modified:
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/CsvRecord.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/AnnotationModelLoader.java
    camel/trunk/components/camel-bindy/src/test/resources/log4j.properties

Added: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java (added)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.dataformat.bindy.util.AnnotationModelLoader;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * The BindyAbstractFactory implements what its common to all the 
+ * formats supported by camel bindy
+ */
+public abstract class BindyAbstractFactory implements BindyFactory {
+    private static final transient Log LOG = LogFactory.getLog(BindyAbstractFactory.class);
+    protected Set<Class<?>> models;
+    protected Map<String, Field> mapAnnotedLinkField = new LinkedHashMap<String, Field>();    
+
+    private AnnotationModelLoader modelsLoader;
+    
+    private String packageName;
+
+    public BindyAbstractFactory(String packageName) throws Exception {
+        modelsLoader = new AnnotationModelLoader();
+        this.packageName = packageName;
+        initModel();
+    }
+
+    /**
+     * method uses to initialize the model representing the classes who will
+     * bind the data. This process will scan for classes according to the package
+     * name provided, check the classes and fields annoted.
+     * 
+     * @throws Exception
+     */
+    public void initModel() throws Exception {
+
+        // Find classes defined as Model
+        initModelClasses(packageName);
+
+    }
+
+    /**
+     * Find all the classes defined as model
+     */
+    private void initModelClasses(String packageName) throws Exception {
+        models = modelsLoader.loadModels(packageName);
+    }
+
+    /**
+     * Find fields annoted in each class of the model
+     */
+    public abstract void initAnnotedFields() throws Exception;
+
+    public abstract void bind(List<String> data, Map<String, Object> model) throws Exception;
+
+    public abstract String unbind(Map<String, Object> model) throws Exception;
+
+    /**
+     * Link objects together (Only 1to1 relation is allowed)
+     */
+    public void link(Map<String, Object> model) throws Exception {
+
+        for (String link : mapAnnotedLinkField.keySet()) {
+
+            Field field = mapAnnotedLinkField.get(link);
+            field.setAccessible(true);
+
+            // Retrieve linked object
+            String toClassName = field.getType().getName();
+            Object to = model.get(toClassName);
+
+            ObjectHelper.notNull(to, "No @link annotation has been defined for the oject to link");
+            field.set(model.get(field.getDeclaringClass().getName()), to);
+
+        }
+    }
+
+    /**
+     * Factory method generating new instances of the model and adding them to a
+     * HashMap
+     * 
+     * @return Map is a collection of the objects used to bind data from records, messages
+     * @throws Exception can be thrown
+     */
+    public Map<String, Object> factory() throws Exception {
+
+        Map<String, Object> mapModel = new HashMap<String, Object>();
+
+        for (Class<?> cl : models) {
+
+            Object obj = ObjectHelper.newInstance(cl);
+
+            // Add instance of the class to the Map Model
+            mapModel.put(obj.getClass().getName(), obj);
+
+        }
+
+        return mapModel;
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyAbstractFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java?rev=748118&r1=748117&r2=748118&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java Thu Feb 26 12:44:02 2009
@@ -17,47 +17,41 @@
 package org.apache.camel.dataformat.bindy;
 
 import java.lang.reflect.Field;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.TreeMap;
 
 import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
 import org.apache.camel.dataformat.bindy.annotation.DataField;
 import org.apache.camel.dataformat.bindy.annotation.Link;
-import org.apache.camel.dataformat.bindy.util.AnnotationModelLoader;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
- * The ModelFactory is the core class of the bindy component and allows to a)
- * Generate a model associated to a record (CSV, ...) b) Bind data from a record
- * to the POJOs c) Export data of POJOs to a record (CSV, ...) d) Format data
+ * The BindyCsvFactory is the class who allows to :
+ * Generate a model associated to a CSV record, bind data from a record
+ * to the POJOs, export data of POJOs to a CSV record and format data
  * into String, Date, Double, ... according to the format/pattern defined
  */
-public class BindyCsvFactory implements BindyFactory {
+public class BindyCsvFactory extends BindyAbstractFactory implements BindyFactory  {
 
     private static final transient Log LOG = LogFactory.getLog(BindyCsvFactory.class);
 
-    private AnnotationModelLoader modelsLoader;
-    private Set<Class<?>> models;
-
     private Map<Integer, DataField> mapDataField = new LinkedHashMap<Integer, DataField>();
     private Map<Integer, Field> mapAnnotedField = new LinkedHashMap<Integer, Field>();
-    private Map<String, Field> mapAnnotedLinkField = new LinkedHashMap<String, Field>();
 
     private String separator;
     private boolean skipFirstLine;
-    private String packageName;
 
     public BindyCsvFactory(String packageName) throws Exception {
-        modelsLoader = new AnnotationModelLoader();
-        this.packageName = packageName;
-        initModel();
+        
+        super(packageName);
+        
+        // initialize specific parameters of the csv model
+        initCsvModel();
     }
 
     /**
@@ -68,37 +62,29 @@
      * 
      * @throws Exception
      */
-    public void initModel() throws Exception {
-
-        // Find classes defined as Model
-        initModelClasses(packageName);
-
-        // Find annotated fields declared in the Model classes
+    public void initCsvModel() throws Exception {
+        
+        // Find annotated Datafields declared in the Model classes
         initAnnotedFields();
-
-        // Get parameters : separator and skipfirstline from
-        // @CSVrecord annotation
+        
+        // initialize Csv parameter(s)
+        // separator and skip first line from @CSVrecord annotation
         initCsvRecordParameters();
 
     }
-
-    /**
-     * Find all the classes defined as model
-     */
-    private void initModelClasses(String packageName) throws Exception {
-        models = modelsLoader.loadModels(packageName);
-    }
-
-    /**
-     * Find fields annoted in each class of the model
-     */
-    private void initAnnotedFields() throws Exception {
+    
+    
+    public void initAnnotedFields() {
 
         for (Class<?> cl : models) {
 
             for (Field field : cl.getDeclaredFields()) {
                 DataField dataField = field.getAnnotation(DataField.class);
                 if (dataField != null) {
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Position defined in the class : " + cl.getName() + ", position : "
+                                  + dataField.pos() + ", Field : " + dataField.toString());
+                    }
                     mapDataField.put(dataField.pos(), dataField);
                     mapAnnotedField.put(dataField.pos(), field);
                 }
@@ -106,12 +92,16 @@
                 Link linkField = field.getAnnotation(Link.class);
 
                 if (linkField != null) {
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Class linked  : " + cl.getName() + ", Field" + field.toString());
+                    }
                     mapAnnotedLinkField.put(cl.getName(), field);
                 }
             }
 
         }
     }
+    
 
     public void bind(List<String> data, Map<String, Object> model) throws Exception {
 
@@ -127,10 +117,13 @@
             if (!data.get(pos).equals("")) {
 
                 DataField dataField = mapDataField.get(pos);
+                ObjectHelper.notNull(dataField, "No position defined for the field positoned : " + pos);
                 Field field = mapAnnotedField.get(pos);
                 field.setAccessible(true);
-
-                LOG.debug("Pos : " + pos + ", Data : " + data.get(pos) + ", Field type : " + field.getType());
+                
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Pos : " + pos + ", Data : " + data.get(pos) + ", Field type : " + field.getType());
+                }
 
                 Format<?> format;
                 String pattern = dataField.pattern();
@@ -149,7 +142,6 @@
 
         StringBuilder builder = new StringBuilder();
 
-        // must use a tree map to get a sorted iterator by the poisition defined by annotations
         Map<Integer, DataField> dataFields = new TreeMap<Integer, DataField>(mapDataField);
         Iterator<Integer> it = dataFields.keySet().iterator();
 
@@ -185,58 +177,14 @@
     }
 
     /**
-     * Link objects together (Only 1to1 relation is allowed)
-     */
-    public void link(Map<String, Object> model) throws Exception {
-
-        for (String link : mapAnnotedLinkField.keySet()) {
-
-            Field field = mapAnnotedLinkField.get(link);
-            field.setAccessible(true);
-
-            // Retrieve linked object
-            String toClassName = field.getType().getName();
-            Object to = model.get(toClassName);
-
-            ObjectHelper.notNull(to, "No @link annotation has been defined for the oject to link");
-            field.set(model.get(field.getDeclaringClass().getName()), to);
-
-        }
-    }
-
-    /**
-     * Factory method generating new instances of the model and adding them to a
-     * HashMap
-     * 
-     * @return Map is a collection of the objects used to bind data from csv
-     *         records
-     * @throws Exception can be thrown
-     */
-    public Map<String, Object> factory() throws Exception {
-
-        Map<String, Object> mapModel = new HashMap<String, Object>();
-
-        for (Class<?> cl : models) {
-
-            Object obj = ObjectHelper.newInstance(cl);
-
-            // Add instance of the class to the Map Model
-            mapModel.put(obj.getClass().getName(), obj);
-
-        }
-
-        return mapModel;
-    }
-
-    /**
      * Find the separator used to delimit the CSV fields
      */
     public String getSeparator() {
         return separator;
     }
-
+    
     /**
-     * Get the parameter skipFirstLine
+     * Find the separator used to delimit the CSV fields
      */
     public boolean getSkipFirstLine() {
         return skipFirstLine;
@@ -258,12 +206,17 @@
 
                     // Get skipFirstLine parameter
                     skipFirstLine = record.skipFirstLine();
-                    LOG.debug("Skip First Line parameter of the CSV : " + skipFirstLine);
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Skip First Line parameter of the CSV : " + skipFirstLine);
+                    }
 
                     // Get Separator parameter
-                    ObjectHelper.notNull(record.separator(), "No separator has been defined in the @Record annotation !");
+                    ObjectHelper.notNull(record.separator(),
+                                         "No separator has been defined in the @Record annotation !");
                     separator = record.separator();
-                    LOG.debug("Separator defined for the CSV : " + separator);
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Separator defined for the CSV : " + separator);
+                    }
 
                 }
 

Added: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java (added)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,268 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy;
+
+import java.lang.reflect.Field;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.swing.plaf.basic.BasicBorders.SplitPaneBorder;
+
+import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
+import org.apache.camel.dataformat.bindy.annotation.DataField;
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+import org.apache.camel.dataformat.bindy.annotation.Message;
+import org.apache.camel.dataformat.bindy.util.ConvertSeparator;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * The BindyKeyValuePairFactory is the class who allows to bind data of type
+ * key value pair. Such format exist in financial messages FIX.
+ * This class allows to generate a model associated to message, bind data from a message
+ * to the POJOs, export data of POJOs to a message and format data
+ * into String, Date, Double, ... according to the format/pattern defined
+ */
+public class BindyKeyValuePairFactory extends BindyAbstractFactory implements BindyFactory  {
+
+    private static final transient Log LOG = LogFactory.getLog(BindyKeyValuePairFactory.class);
+
+    private Map<Integer, KeyValuePairField> mapKeyValuePairField = new LinkedHashMap<Integer, KeyValuePairField>();
+    private Map<Integer, Field> mapAnnotedField = new LinkedHashMap<Integer, Field>();
+
+    private String keyValuePairSeparator;
+    private String pairSeparator;
+
+    public BindyKeyValuePairFactory(String packageName) throws Exception {
+        
+        super(packageName);
+        
+        // Initialize what is specific to Key Value Pair model
+        initKeyValuePairModel();
+    }
+
+    /**
+     * method uses to initialize the model representing the classes who will
+     * bind the data This process will scan for classes according to the package
+     * name provided, check the classes and fields annoted. Next, we retrieve the
+     * parameters required like : Pair Separator & key value pair separator
+     * 
+     * @throws Exception
+     */
+    public void initKeyValuePairModel() throws Exception {
+        
+        // Find annotated KeyValuePairfields declared in the Model classes
+        initAnnotedFields();
+        
+        // Initialize key value pair parameter(s) 
+        initMessageParameters();
+
+    }
+    
+    
+    public void initAnnotedFields() {
+
+        for (Class<?> cl : models) {
+
+            for (Field field : cl.getDeclaredFields()) {
+                KeyValuePairField keyValuePairField = field.getAnnotation(KeyValuePairField.class);
+                if (keyValuePairField != null) {
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Key declared in the class : " + cl.getName() + ", key : "
+                                  + keyValuePairField.tag() + ", Field : " + keyValuePairField.toString());
+                    }
+                    mapKeyValuePairField.put(keyValuePairField.tag(), keyValuePairField);
+                    mapAnnotedField.put(keyValuePairField.tag(), field);
+                }
+
+                Link linkField = field.getAnnotation(Link.class);
+
+                if (linkField != null) {
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Class linked  : " + cl.getName() + ", Field" + field.toString());
+                    }
+                    mapAnnotedLinkField.put(cl.getName(), field);
+                }
+            }
+
+        }
+    }
+    
+
+    public void bind(List<String> data, Map<String, Object> model) throws Exception {
+
+        int pos = 0;
+        
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Data : " + data);
+        }
+
+        while (pos < data.size()) {
+        
+            if (!data.get(pos).equals("")) {
+           
+                // Separate the key from its value
+                // e.g 8=FIX 4.1 --> key = 8 and Value = FIX 4.1
+                ObjectHelper.notNull(this.keyValuePairSeparator, "Key Value Pair not defined in the @Message annotation");
+                String[] keyValuePair = data.get(pos).split(this.getKeyValuePairSeparator());
+                
+                int tag = Integer.parseInt(keyValuePair[0]);
+                String value = keyValuePair[1];
+                
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Key : " + tag + ", value : " + value);
+                }
+
+                KeyValuePairField keyValuePairField = mapKeyValuePairField.get(tag);
+                ObjectHelper.notNull(keyValuePairField, "No tag defined for the field : " + tag);
+
+                Field field = mapAnnotedField.get(tag);
+                field.setAccessible(true);
+
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Tag : " + tag + ", Data : " + value + ", Field type : " + field.getType());
+                }
+
+                Format<?> format;
+                String pattern = keyValuePairField.pattern();
+
+                format = FormatFactory.getFormat(field.getType(), pattern, keyValuePairField.precision());
+                field.set(model.get(field.getDeclaringClass().getName()), format.parse(value));
+
+            }
+
+            pos++;
+        }
+
+    }
+
+    public String unbind(Map<String, Object> model) throws Exception {
+
+        StringBuilder builder = new StringBuilder();
+
+        Map<Integer, KeyValuePairField> keyValuePairFields = new TreeMap<Integer, KeyValuePairField>(mapKeyValuePairField);
+        Iterator<Integer> it = keyValuePairFields.keySet().iterator();
+
+        // Check if separator exists
+        ObjectHelper
+            .notNull(this.pairSeparator,
+                     "The pair separator has not been instantiated or property not defined in the @Message annotation");
+
+        char separator = ConvertSeparator.getCharDelimitor(this.getPairSeparator());
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Separator converted : " + separator + ", from : " + this.getPairSeparator());
+        }
+
+        while (it.hasNext()) {
+
+            KeyValuePairField keyValuePairField = mapKeyValuePairField.get(it.next());
+            ObjectHelper.notNull(keyValuePairField, "KeyValuePair is null !");
+
+            // Retrieve the field
+            Field field = mapAnnotedField.get(keyValuePairField.tag());
+            // Change accessibility to allow to read protected/private fields
+            field.setAccessible(true);
+
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Tag : " + keyValuePairField.tag() + ", Field type : " + field.getType()
+                          + ", class : " + field.getDeclaringClass().getName());
+            }
+
+            // Retrieve the format associated to the type
+            Format format;
+
+            String pattern = keyValuePairField.pattern();
+            format = FormatFactory.getFormat(field.getType(), pattern, keyValuePairField.precision());
+
+            Object obj = model.get(field.getDeclaringClass().getName());
+
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Model object : " + obj.toString());
+            }
+
+            // Convert the content to a String and append it to the builder
+            // Add the tag followed by its key value pair separator
+            // the data and finish by the pair separator
+            builder.append(keyValuePairField.tag() + this.getKeyValuePairSeparator()
+                           + format.format(field.get(obj)) + separator);
+        }
+
+        return builder.toString();
+    }
+
+    /**
+     * Find the pair separator used to delimit the key value pair fields
+     */
+    public String getPairSeparator() {
+        return pairSeparator;
+    }
+    
+    /**
+     * Find the key value pair separator used to link the key with its value
+     */
+    public String getKeyValuePairSeparator() {
+        return keyValuePairSeparator;
+    }
+
+    /**
+     * Get parameters defined in @Message annotation
+     */
+    private void initMessageParameters() {
+
+        if ((pairSeparator == null) || (keyValuePairSeparator == null)) {
+
+            for (Class<?> cl : models) {
+                
+                // Get annotation @Message from the class
+                Message message = cl.getAnnotation(Message.class);
+
+                if (message != null) {
+                    
+                    // Get Pair Separator parameter
+                    ObjectHelper.notNull(message.pairSeparator(),
+                                         "No Pair Separator has been defined in the @Message annotation !");
+                    pairSeparator = message.pairSeparator();
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Pair Separator defined for the message : " + pairSeparator);
+                    }
+
+                    // Get KeyValuePair Separator parameter
+                    ObjectHelper
+                        .notNull(message.keyValuePairSeparator(),
+                                 "No Key Value Pair Separator has been defined in the @Message annotation !");
+                    keyValuePairSeparator = message.keyValuePairSeparator();
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Key Value Pair Separator defined for the message : "
+                                  + keyValuePairSeparator);
+                    }
+
+                }
+
+            }
+
+        }
+
+    }
+    
+
+}

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/CsvRecord.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/CsvRecord.java?rev=748118&r1=748117&r2=748118&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/CsvRecord.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/CsvRecord.java Thu Feb 26 12:44:02 2009
@@ -21,11 +21,13 @@
 import java.lang.annotation.RetentionPolicy;
 
 /**
- * This annotation represents the root class of the model When a CSV,
+ * This annotation represents the root class of the model. When a CSV,
  * fixed-length record must be described in the model we will use this
  * annotation and the separator (for csv record) to know how to split the data
- * during the unmarshal process a) separator (mandatory) b) name (optional) c)
- * skipfirstline (optional)
+ * during the unmarshal process
+ * The separator (mandatory)
+ * The name is optional and could be used in the future to bind a property which a different name
+ * The skipfirstline (optional) allows to skip the first line of the file/content received
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java?rev=748118&r1=748117&r2=748118&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/DataField.java Thu Feb 26 12:44:02 2009
@@ -22,12 +22,12 @@
 
 /**
  * An annotation used to identify in a POJO which property is link to a field of
- * a record (csv, ...) a) position identifies the position of the data in the
- * record (mandatory) b) name is optional and could be used in the future to
- * bind a property which a different name c) pattern which is optional allows to
- * define the pattern of the data (useful for Date, ...) d) length allows to
- * define for fixed length message the size of the data's block e) precision
- * reflects the precision to be used with BigDecimal number
+ * a record (csv, ...).
+ * The position (mandatory) identifies the position of the data in the record
+ * The name is optional and could be used in the future to bind a property which a different name
+ * The pattern (optional) allows to define the pattern of the data (useful for Date, ...)
+ * The length (optional) allows to define for fixed length message the size of the data's block
+ * The precision(optional) reflects the precision to be used with BigDecimal number
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)

Added: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java (added)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * An annotation used to identify in a POJO which property is link to a key value pair field
+ * The tag (mandatory) identifies the key of the key value pair (e.g. 8 equals the begin string in FIX
+ * The name (optional) could be used in the future to bind a property which a different name
+ * The pattern (optional) allows to define the pattern of the data (useful for Date, BigDecimal ...)
+ * The precision (optional) reflects the precision to be used with BigDecimal number
+ * The required (optional) field allows to define if the field is required or not. This property is
+ * not yet used but will be useful in the future with the validation
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+public @interface KeyValuePairField {
+
+    /**
+     * tag identifying the field in the message (mandatory)
+     * 
+     * @return int
+     */
+    int tag();
+
+    /**
+     * name of the field (optional)
+     * 
+     * @return String
+     */
+    String name() default "";
+
+    /**
+     * pattern that the formater will use to transform the data (optional)
+     * 
+     * @return String
+     */
+    String pattern() default "";
+
+    /**
+     * precision of the BigDecimal number to be created
+     * 
+     * @return int
+     */
+    int precision() default 0;
+    
+    boolean required() default false;
+
+}

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/KeyValuePairField.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java (added)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * This annotation represents the root class of the model. When a message (FIX message
+ * containing key-value pairs) must be described in the model, we will use this
+ * annotation.
+
+ * The key pair separator (mandatory) defines the separator between the key and the value
+ * The pair separator (mandatory) allows to define which character separate the pairs from each other
+ * The name is optional and could be used in the future to bind a property which a different name
+ * The type (optional) allow to define the type of the message (e.g. FIX, EMX, ...)
+ * The version (optional) defines the version of the message (e.g. 4.1, ...)
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Message {
+
+    /**
+     * Name describing the message (optional)
+     * 
+     * @return String
+     */
+    String name() default "";
+
+    /**
+     * Pair separator used to split the key value pairs in tokens (mandatory)
+     * 
+     * @return String
+     */
+    String pairSeparator();
+    
+    /**
+     * Key value pair separator is used to split the values from their keys (mandatory)
+     * 
+     * @return String
+     */
+    String keyValuePairSeparator();
+    
+    
+    /**
+     * type is used to define the type of the message (e.g. FIX, EMX, ...) (optional)
+     */
+    String type() default "FIX";
+    
+    /**
+     * version defines the version of the message (e.g. 4.1, ...) (optional)
+     */
+    String version() default "4.1";
+
+}

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/annotation/Message.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java?rev=748118&r1=748117&r2=748118&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java Thu Feb 26 12:44:02 2009
@@ -89,7 +89,7 @@
 
                 // Read the line
                 String line = scanner.nextLine().trim();
-
+                
                 if (ObjectHelper.isEmpty(line)) {
                     // skip if line is empty
                     continue;
@@ -102,7 +102,7 @@
                 // Split the CSV record according to the separator defined in
                 // annotated class @CSVRecord
                 List<String> result = Arrays.asList(line.split(separator));
-
+                
                 // Bind data from CSV record with model classes
                 getFactory().bind(result, model);
 

Added: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java (added)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,150 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.kvp;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Scanner;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.dataformat.bindy.BindyCsvFactory;
+import org.apache.camel.dataformat.bindy.BindyKeyValuePairFactory;
+import org.apache.camel.spi.DataFormat;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * A <a href="http://camel.apache.org/data-format.html">data format</a>
+ * ({@link DataFormat}) using Bindy to marshal to and from CSV files
+ */
+public class BindyKeyValuePairDataFormat implements DataFormat {
+    
+    private static final transient Log LOG = LogFactory.getLog(BindyKeyValuePairDataFormat.class);
+
+    private String packageName;
+    private BindyKeyValuePairFactory modelFactory;
+
+    public BindyKeyValuePairDataFormat() {
+    }
+
+    public BindyKeyValuePairDataFormat(String packageName) {
+        this.packageName = packageName;
+    }
+
+    @SuppressWarnings("unchecked")
+    public void marshal(Exchange exchange, Object body, OutputStream outputStream) throws Exception {
+        List<Map<String, Object>> models = (ArrayList<Map<String, Object>>) body;
+        
+        for (Map<String, Object> model : models) {
+
+            String result = getFactory().unbind(model);
+            byte[] bytes = exchange.getContext().getTypeConverter().convertTo(byte[].class, exchange, result);
+            outputStream.write(bytes);
+        }
+    }
+
+    public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception {
+
+        // List of Pojos
+        List<Map<String, Object>> models = new ArrayList<Map<String, Object>>();
+
+        // Create POJO where messages data will be saved
+        Map<String, Object> model = getFactory().factory();
+
+        InputStreamReader in = new InputStreamReader(inputStream);
+
+        // Scanner is used to read big file
+        Scanner scanner = new Scanner(in);
+
+        // Retrieve the pair separator defined to split the record
+        ObjectHelper.notEmpty(getFactory().getPairSeparator(), "The separator has not been defined in the annotation @Message.");
+        String separator = getFactory().getPairSeparator();
+
+        int count = 0;
+        try {
+
+            while (scanner.hasNextLine()) {
+
+                // Read the line
+                String line = scanner.nextLine().trim();
+
+                if (ObjectHelper.isEmpty(line)) {
+                    // skip if line is empty
+                    continue;
+                }
+
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Counter " + count++ + " : content : " + line);
+                }
+
+                // Split the message according to the pair separator defined in
+                // annotated class @Message
+                List<String> result = Arrays.asList(line.split(separator));
+                
+                // Bind data from message with model classes
+                getFactory().bind(result, model);
+
+                // Link objects together
+                getFactory().link(model);
+
+                // Add objects graph to the list
+                models.add(model);
+
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Graph of objects created : " + model);
+                }
+
+            }
+
+            return models;
+
+        } finally {
+            scanner.close();
+            ObjectHelper.close(in, "in", LOG);
+        }
+
+    }
+
+    /**
+     * Method used to create the singleton of the BindyKeyValuePairFactory
+     */
+    public BindyKeyValuePairFactory getFactory() throws Exception {
+        if (modelFactory == null) {
+            modelFactory = new BindyKeyValuePairFactory(this.packageName);
+        }
+        return modelFactory;
+    }
+
+    public void setModelFactory(BindyKeyValuePairFactory modelFactory) {
+        this.modelFactory = modelFactory;
+    }
+
+    public String getPackageName() {
+        return packageName;
+    }
+
+    public void setPackageName(String packageName) {
+        this.packageName = packageName;
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/AnnotationModelLoader.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/AnnotationModelLoader.java?rev=748118&r1=748117&r2=748118&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/AnnotationModelLoader.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/AnnotationModelLoader.java Thu Feb 26 12:44:02 2009
@@ -22,6 +22,7 @@
 
 import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
 import org.apache.camel.dataformat.bindy.annotation.Link;
+import org.apache.camel.dataformat.bindy.annotation.Message;
 import org.apache.camel.util.ResolverUtil;
 
 /**
@@ -38,6 +39,7 @@
         annotations = new LinkedHashSet<Class<? extends Annotation>>();
         annotations.add(CsvRecord.class);
         annotations.add(Link.class);
+        annotations.add(Message.class);
     }
 
     public Set<Class<?>> loadModels(String packageName) throws Exception {

Added: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java (added)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.util;
+
+/**
+ * 
+ * The ConvertSeparator helps to return the char associated to the unicode string
+ *
+ */
+public final class ConvertSeparator {
+    
+    private ConvertSeparator() {
+        // helper class
+    }
+
+    public static char getCharDelimitor(String separator) {
+
+        if (separator.equals("\\u0001")) {
+            return '\u0001';
+        } else if (separator.equals("\\t") || separator.equals("\\u0009")) {
+            return '\u0009';
+        } else {
+            return separator.charAt(0);
+        }
+
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/util/ConvertSeparator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt (added)
+++ camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt Thu Feb 26 12:44:02 2009
@@ -0,0 +1,11 @@
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220

Propchange: camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/data/fix/fix.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt (added)
+++ camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt Thu Feb 26 12:44:02 2009
@@ -0,0 +1 @@
+8=FIX.4.19=2034=135=049=INVMGR56=BRKR1=BE.CHM.00111=CHM0001-0122=448=BE000124567854=158=this is a camel - bindy test10=220

Propchange: camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/data/fix_tab/fix_tab.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,112 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.fix;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat;
+import org.apache.camel.dataformat.bindy.model.fix.simple.Header;
+import org.apache.camel.dataformat.bindy.model.fix.simple.Order;
+import org.apache.camel.dataformat.bindy.model.fix.simple.Trailer;
+import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
+import org.junit.Test;
+import org.springframework.config.java.annotation.Bean;
+import org.springframework.config.java.annotation.Configuration;
+import org.springframework.config.java.test.JavaConfigContextLoader;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+@ContextConfiguration(locations = "org.apache.camel.dataformat.bindy.fix.BindySimpleKeyValuePairMarshallTest$ContextConfig", loader = JavaConfigContextLoader.class)
+public class BindySimpleKeyValuePairMarshallTest extends AbstractJUnit4SpringContextTests {
+
+    private List<Map<String, Object>> models = new ArrayList<Map<String, Object>>();
+    private String result = "1=BE.CHM.0018=FIX 4.19=2010=22011=CHM0001-0122=434=135=048=BE000124567849=INVMGR54=156=BRKR58=this is a camel - bindy test";
+
+    @Produce(uri = "direct:start")
+    private ProducerTemplate template;
+
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint resultEndpoint;
+
+    @Test
+    public void testMarshallMessage() throws Exception {
+        resultEndpoint.expectedBodiesReceived(result);
+
+        template.sendBody(generateModel());
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    public List<Map<String, Object>> generateModel() {
+        Map<String, Object> modelObjects = new HashMap<String, Object>();
+
+        Header header = new Header();
+        header.setBeginString("FIX 4.1");
+        header.setBodyLength(20);
+        header.setMsgSeqNum(1);
+        header.setMsgType("0");
+        header.setSendCompId("INVMGR");
+        header.setTargetCompId("BRKR");
+        
+        Trailer trailer = new Trailer();
+        trailer.setCheckSum(220); 
+        
+        Order order = new Order();
+        order.setAccount("BE.CHM.001");
+        order.setClOrdId("CHM0001-01");
+        order.setIDSource("4");
+        order.setSecurityId("BE0001245678");
+        order.setSide("1");
+        order.setText("this is a camel - bindy test");
+        
+        order.setHeader(header);
+        order.setTrailer(trailer);
+        
+        modelObjects.put(order.getClass().getName(), order);
+        modelObjects.put(header.getClass().getName(), header);
+        modelObjects.put(trailer.getClass().getName(), trailer);
+ 
+        models.add(modelObjects);
+
+        return models;
+    }
+
+    @Configuration
+    public static class ContextConfig extends SingleRouteCamelConfiguration {
+        BindyKeyValuePairDataFormat camelDataFormat = new BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.simple");
+
+        @Override
+        @Bean
+        public RouteBuilder route() {
+            return new RouteBuilder() {
+                @Override
+                public void configure() {
+                    from("direct:start").marshal(camelDataFormat).to("mock:result");
+                }
+            };
+        }
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairMarshallTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,113 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.fix;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat;
+import org.apache.camel.dataformat.bindy.model.fix.simple.Header;
+import org.apache.camel.dataformat.bindy.model.fix.simple.Order;
+import org.apache.camel.dataformat.bindy.model.fix.simple.Trailer;
+import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
+import org.junit.Test;
+import org.springframework.config.java.annotation.Bean;
+import org.springframework.config.java.annotation.Configuration;
+import org.springframework.config.java.test.JavaConfigContextLoader;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+@ContextConfiguration(locations = "org.apache.camel.dataformat.bindy.fix.BindySimpleKeyValuePairTabMarshallTest$ContextConfig", loader = JavaConfigContextLoader.class)
+public class BindySimpleKeyValuePairTabMarshallTest extends AbstractJUnit4SpringContextTests {
+
+    private List<Map<String, Object>> models = new ArrayList<Map<String, Object>>();
+    
+    private String result = "1=BE.CHM.0018=FIX 4.19=2010=22011=CHM0001-0122=434=135=048=BE000124567849=INVMGR54=156=BRKR58=this is a camel - bindy test";
+    
+    @Produce(uri = "direct:start")
+    private ProducerTemplate template;
+
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint resultEndpoint;
+
+    @Test
+    public void testMarshallMessage() throws Exception {
+        resultEndpoint.expectedBodiesReceived(result);
+
+        template.sendBody(generateModel());        
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    public List<Map<String, Object>> generateModel() {
+        Map<String, Object> modelObjects = new HashMap<String, Object>();
+
+        Header header = new Header();
+        header.setBeginString("FIX 4.1");
+        header.setBodyLength(20);
+        header.setMsgSeqNum(1);
+        header.setMsgType("0");
+        header.setSendCompId("INVMGR");
+        header.setTargetCompId("BRKR");
+        
+        Trailer trailer = new Trailer();
+        trailer.setCheckSum(220); 
+        
+        Order order = new Order();
+        order.setAccount("BE.CHM.001");
+        order.setClOrdId("CHM0001-01");
+        order.setIDSource("4");
+        order.setSecurityId("BE0001245678");
+        order.setSide("1");
+        order.setText("this is a camel - bindy test");
+        
+        order.setHeader(header);
+        order.setTrailer(trailer);
+        
+        modelObjects.put(order.getClass().getName(), order);
+        modelObjects.put(header.getClass().getName(), header);
+        modelObjects.put(trailer.getClass().getName(), trailer);
+ 
+        models.add(modelObjects);
+
+        return models;
+    }
+
+    @Configuration
+    public static class ContextConfig extends SingleRouteCamelConfiguration {
+        BindyKeyValuePairDataFormat camelDataFormat = new BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.simple");
+
+        @Override
+        @Bean
+        public RouteBuilder route() {
+            return new RouteBuilder() {
+                @Override
+                public void configure() {
+                    from("direct:start").marshal(camelDataFormat).to("mock:result");
+                }
+            };
+        }
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.fix;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat;
+import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
+import org.junit.Test;
+import org.springframework.config.java.annotation.Bean;
+import org.springframework.config.java.annotation.Configuration;
+import org.springframework.config.java.test.JavaConfigContextLoader;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+@ContextConfiguration(locations = "org.apache.camel.dataformat.bindy.fix.BindySimpleKeyValuePairTabUnmarshallTest$ContextConfig", loader = JavaConfigContextLoader.class)
+public class BindySimpleKeyValuePairTabUnmarshallTest extends AbstractJUnit4SpringContextTests {
+
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint resultEndpoint;
+
+    @Test
+    public void testUnMarshallMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Configuration
+    public static class ContextConfig extends SingleRouteCamelConfiguration {
+        BindyKeyValuePairDataFormat camelDataFormat = new BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.simple");
+
+        @Override
+        @Bean
+        public RouteBuilder route() {
+            return new RouteBuilder() {
+                @Override
+                public void configure() {
+                    from("file://src/test/data/fix_tab?noop=true").unmarshal(camelDataFormat).to("mock:result");
+                }
+            };
+        }
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.fix;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat;
+import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
+import org.junit.Test;
+import org.springframework.config.java.annotation.Bean;
+import org.springframework.config.java.annotation.Configuration;
+import org.springframework.config.java.test.JavaConfigContextLoader;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+@ContextConfiguration(locations = "org.apache.camel.dataformat.bindy.fix.BindySimpleKeyValuePairUnmarshallTest$ContextConfig", loader = JavaConfigContextLoader.class)
+public class BindySimpleKeyValuePairUnmarshallTest extends AbstractJUnit4SpringContextTests {
+
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint resultEndpoint;
+
+    @Test
+    public void testUnMarshallMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Configuration
+    public static class ContextConfig extends SingleRouteCamelConfiguration {
+        BindyKeyValuePairDataFormat camelDataFormat = new BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.simple");
+
+        @Override
+        @Bean
+        public RouteBuilder route() {
+            return new RouteBuilder() {
+                @Override
+                public void configure() {
+                    from("file://src/test/data/fix?noop=true").unmarshal(camelDataFormat).to("mock:result");
+                }
+            };
+        }
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairUnmarshallTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.model.fix.simple;
+
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+
+@Link
+public class Header {
+
+    @KeyValuePairField(tag = 8) // Message Header
+    private String beginString;
+
+    @KeyValuePairField(tag = 9) // Checksum
+    private int bodyLength;
+    
+    @KeyValuePairField(tag = 34) // Sequence number
+    private int msgSeqNum;
+    
+    @KeyValuePairField(tag = 35) // Message Type
+    private String msgType;
+
+    @KeyValuePairField(tag = 49) // Company sender Id
+    private String sendCompId;
+    
+    @KeyValuePairField(tag = 56) // target company id
+    private String targetCompId;
+
+    public String getBeginString() {
+        return beginString;
+    }
+
+    public void setBeginString(String beginString) {
+        this.beginString = beginString;
+    }
+
+    public int getBodyLength() {
+        return bodyLength;
+    }
+
+    public void setBodyLength(int bodyLength) {
+        this.bodyLength = bodyLength;
+    }
+
+    public int getMsgSeqNum() {
+        return msgSeqNum;
+    }
+
+    public void setMsgSeqNum(int msgSeqNum) {
+        this.msgSeqNum = msgSeqNum;
+    }
+
+    public String getMsgType() {
+        return msgType;
+    }
+
+    public void setMsgType(String msgType) {
+        this.msgType = msgType;
+    }
+
+    public String getSendCompId() {
+        return sendCompId;
+    }
+
+    public void setSendCompId(String sendCompId) {
+        this.sendCompId = sendCompId;
+    }
+
+    public String getTargetCompId() {
+        return targetCompId;
+    }
+
+    public void setTargetCompId(String targetCompId) {
+        this.targetCompId = targetCompId;
+    }
+    
+    @Override
+    public String toString() {
+        return "Model : " + Header.class.getName()
+            + ", " + this.beginString + ", " + this.bodyLength + ", " + this.msgSeqNum
+            + this.msgType + ", " + this.sendCompId + ", " + this.targetCompId;
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Header.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,119 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.model.fix.simple;
+
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+import org.apache.camel.dataformat.bindy.annotation.Message;
+
+@Message(keyValuePairSeparator = "=", pairSeparator = "\\u0001", type = "FIX", version = "4.1")
+public class Order {
+    
+    @Link Header header;
+    
+    @Link Trailer trailer;
+
+    @KeyValuePairField(tag = 1) // Client reference
+    private String account;
+
+    @KeyValuePairField(tag = 11) // Order reference
+    private String clOrdId;
+    
+    @KeyValuePairField(tag = 22) // Fund ID type (Sedol, ISIN, ...)
+    private String iDSource;
+    
+    @KeyValuePairField(tag = 48) // Fund code
+    private String securityId;
+    
+    @KeyValuePairField(tag = 54) // Movement type ( 1 = Buy, 2 = sell)
+    private String side;
+    
+    @KeyValuePairField(tag = 58) // Free text
+    private String text;
+
+    public Header getHeader() {
+        return header;
+    }
+
+    public void setHeader(Header header) {
+        this.header = header;
+    }
+
+    public Trailer getTrailer() {
+        return trailer;
+    }
+
+    public void setTrailer(Trailer trailer) {
+        this.trailer = trailer;
+    }
+ 
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getClOrdId() {
+        return clOrdId;
+    }
+
+    public void setClOrdId(String clOrdId) {
+        this.clOrdId = clOrdId;
+    }
+
+    public String getIDSource() {
+        return iDSource;
+    }
+
+    public void setIDSource(String source) {
+        this.iDSource = source;
+    }
+
+    public String getSecurityId() {
+        return securityId;
+    }
+
+    public void setSecurityId(String securityId) {
+        this.securityId = securityId;
+    }
+
+    public String getSide() {
+        return side;
+    }
+
+    public void setSide(String side) {
+        this.side = side;
+    }
+
+    public String getText() {
+        return this.text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+    
+    @Override
+    public String toString() {
+        return "Model : " + Order.class.getName() + ", " + this.account
+            + ", " + this.clOrdId + ", " + this.iDSource + ", " + this.securityId
+            + ", " + this.side + ", " + this.text;
+    }
+
+}

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Order.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java?rev=748118&view=auto
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java (added)
+++ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java Thu Feb 26 12:44:02 2009
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.model.fix.simple;
+
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+
+@Link
+public class Trailer {
+
+    @KeyValuePairField(tag = 10)
+    // CheckSum
+    private int checkSum;
+
+    public int getCheckSum() {
+        return checkSum;
+    }
+
+    public void setCheckSum(int checkSum) {
+        this.checkSum = checkSum;
+    }
+
+    @Override
+    public String toString() {
+        return "Model : " + Trailer.class.getName() + ", " + this.checkSum;
+    }
+
+}
\ No newline at end of file

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/simple/Trailer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-bindy/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/resources/log4j.properties?rev=748118&r1=748117&r2=748118&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-bindy/src/test/resources/log4j.properties Thu Feb 26 12:44:02 2009
@@ -18,7 +18,7 @@
 #
 # The logging properties used during tests..
 #
-log4j.rootLogger=INFO, file
+log4j.rootLogger=info, file
 
 # CONSOLE appender not used by default
 log4j.appender.console=org.apache.log4j.ConsoleAppender



Mime
View raw message