Modified: websites/production/camel/content/bindy.html
==============================================================================
--- websites/production/camel/content/bindy.html (original)
+++ websites/production/camel/content/bindy.html Sat Jul 11 15:19:53 2015
@@ -85,67 +85,67 @@
         <tr>
         <td valign="top" width="100%">
 <div class="wiki-content maincontent"><h2 id="Bindy-Bindy">Bindy</h2><p>The 
goal of this component is to allow the parsing/binding of non-structured data 
(or to be more precise non-XML data)<br clear="none"> to/from Java Beans that 
have binding mappings defined with annotations. Using Bindy, you can bind data 
from sources such as :</p><ul class="alternate"><li>CSV 
records,</li><li>Fixed-length records,</li><li>FIX messages,</li><li>or almost 
any other non-structured data</li></ul><p>to one or many Plain Old Java Object 
(POJO). Bindy converts the data according to the type of the java property. 
POJOs can be linked together with one-to-many relationships available in some 
cases. Moreover, for data type like Date, Double, Float, Integer, Short, Long 
and BigDecimal, you can provide the pattern to apply during the formatting of 
the property.</p><p>For the BigDecimal numbers, you can also define the 
precision and the decimal or grouping separators.</p><div 
class="table-wrap"><table class=
 "confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Format Type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Pattern example</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Link</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Date</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>DateFormat</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>"dd-MM-yyyy"</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><a shape="rect" class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html"; 
rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html</a></p></td></tr><tr><td
 colspan="1" rowspan="1" class="confluenceTd"><p>Decimal*</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Decimalformat</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>
 "##.###.###"</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><a 
shape="rect" class="external-link" 
href="http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html"; 
rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html</a></p></td></tr></tbody></table></div><p>Decimal*
 = Double, Integer, Float, Short, Long</p><div 
class="confluence-information-macro confluence-information-macro-note"><p 
class="title">Format supported</p><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>This first release only support 
comma separated values fields and key value pair fields (e.g. : FIX 
messages).</p></div></div><p>To work with camel-bindy, you must first define 
your model in a package (e.g. com.acme.model) and for each model class (e.g. 
Order, Client, Instrument, ...) add the required annotations (described 
hereafter) to the Class or field.</p><div cla
 ss="confluence-information-macro confluence-information-macro-note"><p 
class="title">Multiple models</p><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>If you use multiple models, each 
model has to be placed in it's own package to prevent unpredictable 
results.</p></div></div><h2 id="Bindy-Annotations">Annotations</h2><p>The 
annotations created allow to map different concept of your model to the POJO 
like :</p><ul class="alternate"><li>Type of record (csv, key value pair (e.g. 
FIX message), fixed length ...),</li><li>Link (to link object in another 
object),</li><li>DataField and their properties (int, type, 
...),</li><li>KeyValuePairField (for key = value format like we have in FIX 
financial messages),</li><li>Section (to identify header, body and footer 
section),</li><li>OneToMany</li></ul><p>This section will describe them 
:</p><h3 id="Bindy-1.CsvRecord">1. CsvRecord</h3><p>The Cs
 vRecord annotation is used to identified the root class of the model. It 
represents a record = a line of a CSV file and can be linked to several 
children model classes.</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Annotation name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Record type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>CsvRecord</strong></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>csv</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Class</p></td></tr></tbody></table></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Parameter name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Info</p></th></tr><tr><td colspan=
 "1" rowspan="1" class="confluenceTd"><p>separator</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - can be ',' or ';' or 'anything'. This value 
is interpreted as a regular expression. If you want to use a sign which has a 
special meaning in regular expressions, e.g. the '|' sign, than you have to 
mask it, like ' <br clear="none" class="atl-forced-newline"> 
|'</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>skipFirstLine</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = false - allow to skip the 
first line of the CSV file</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>crlf</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - possible values = WINDOWS,UNIX,MAC, or cust
 om; default value = WINDOWS - allow to define the carriage return character to 
use. If you specify a value other than the three listed before, the value you 
enter (custom) will be used as the CRLF character(s)</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>generateHeaderColumns</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = false - uses to generate the 
header columns of the CSV generates</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>autospanLine</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.13/2.12.2:</strong> optional - default 
value = false - if enabled then the last column is auto spanned to end of line, 
for example if its a comment, etc this allows the line to contain all 
characters, also the delimiter char.</p></td></tr><tr><td col
 span="1" rowspan="1" class="confluenceTd"><p>isOrdered</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = false - allow to change the 
order of the fields when CSV is generated</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>quote</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.8.3/2.9:</strong> option - allow to 
specify a quote character of the fields when CSV is 
generated</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>This annotation is associated to the root class of the 
model and must be declared one time.</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd">quoting</td><td colspan="1" rowspan="1" 
 class="confluenceTd">boolean</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Camel 2.11:</strong>optional - default value = 
false -&#160;Indicate if the values must be quoted when marshaling when CSV is 
generated.</td></tr></tbody></table></div><p><strong>case 1 : separator = 
','</strong></p><p>The separator used to segregate the fields in the CSV record 
is ',' :</p><p>10, J, Pauline, M, XD12345678, Fortis Dynamic 15/15, 2500, 
USD,08-01-2009</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( separator = "," )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( separator = &quot;,&quot; )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 2 : separator = ';'</strong></p><p>Compare to the 
previous case, the separator here is ';' instead of ',' :</p><p>10; J; Pauline; 
M; XD12345678; Fortis Dynamic 15/15; 2500; USD; 08-01-2009</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( separator = ";" )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( separator = &quot;;&quot; )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 3 : separator = '|'</strong></p><p>Compare to the 
previous case, the separator here is '|' instead of ';' :</p><p>10| J| Pauline| 
M| XD12345678| Fortis Dynamic 15/15| 2500| USD| 08-01-2009</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( separator = "\\|" )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( separator = &quot;\\|&quot; )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 4 : separator = '\",\"'</strong><br clear="none"> 
<strong>Applies for Camel 2.8.2 or older</strong></p><p>When the field to be 
parsed of the CSV record contains ',' or ';' which is also used as separator, 
we whould find another strategy<br clear="none"> to tell camel bindy how to 
handle this case. To define the field containing the data with a comma, you 
will use simple or double quotes<br clear="none"> as delimiter (e.g : '10', 
'Street 10, NY', 'USA' or "10", "Street 10, NY", "USA").<br clear="none"> 
Remark : In this case, the first and last character of the line which are a 
simple or double quotes will removed by bindy</p><p>"10","J","Pauline"," 
M","XD12345678","Fortis Dynamic 15,15" 2500","USD","08-01-2009"</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( separator = "\",\"" )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( separator = 
&quot;\&quot;,\&quot;&quot; )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p>From <strong>Camel 2.8.3/2.9 or never</strong> bindy will 
automatic detect if the record is enclosed with either single or double quotes 
and automatic remove those quotes when unmarshalling from CSV to Object. 
Therefore do <strong>not</strong> include the quotes in the separator, but 
simple do as below:</p><p>"10","J","Pauline"," M","XD12345678","Fortis Dynamic 
15,15" 2500","USD","08-01-2009"</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( separator = "," )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( separator = &quot;,&quot; )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p>Notice that if you want to marshal from Object to CSV and use 
quotes, then you need to specify which quote character to use, using the 
<code>quote</code> attribute on the @CsvRecord as shown below:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( separator = ",", quote = "\"" )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( separator = &quot;,&quot;, quote 
= &quot;\&quot;&quot; )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 5 : separator &amp; 
skipfirstline</strong></p><p>The feature is interesting when the client wants 
to have in the first line of the file, the name of the data fields 
:</p><p>order id, client id, first name, last name, isin code, instrument name, 
quantity, currency, date</p><p>To inform bindy that this first line must be 
skipped during the parsing process, then we use the attribute :</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",", skipFirstLine = true)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;, 
skipFirstLine = true)
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 6 : generateHeaderColumns</strong></p><p>To add at 
the first line of the CSV generated, the attribute generateHeaderColumns must 
be set to true in the annotation like this :</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord( generateHeaderColumns = true )
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord( generateHeaderColumns = true )
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p>As a result, Bindy during the unmarshaling process will 
generate CSV like this :</p><p>order id, client id, first name, last name, isin 
code, instrument name, quantity, currency, date<br clear="none"> 10, J, 
Pauline, M, XD12345678, Fortis Dynamic 15/15, 2500, 
USD,08-01-2009</p><p><strong>case 7 : carriage return</strong></p><p>If the 
platform where camel-bindy will run is not Windows but Macintosh or Unix, than 
you can change the crlf property like this. Three values are available : 
WINDOWS, UNIX or MAC</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",", crlf="MAC")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;, 
crlf=&quot;MAC&quot;)
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p>Additionally, if for some reason you need to add a different 
line ending character, you can opt to specify it using the crlf parameter. In 
the following example, we can end the line with a comma followed by the newline 
character:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",", crlf=",\n")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;, 
crlf=&quot;,\n&quot;)
 public Class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 8 : isOrdered</strong></p><p>Sometimes, the order 
to follow during the creation of the CSV record from the model is different 
from the order used during the parsing. Then, in this case, we can use the 
attribute isOrdered = true to indicate this in combination with attribute 
'position' of the DataField annotation.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(isOrdered = true)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(isOrdered = true)
 public Class Order {
 
    @DataField(pos = 1, position = 11)
@@ -156,9 +156,9 @@ public Class Order {
 
 ...
 }
-</pre>
+]]></script>
 </div></div><p>Remark : pos is used to parse the file, stream while positions 
is used to generate the CSV</p><h3 id="Bindy-2.Link">2. Link</h3><p>The link 
annotation will allow to link objects together.</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Annotation name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Record type</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Link</strong></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>all</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Class &amp; 
Property</p></td></tr></tbody></table></div><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Parameter name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" class="conflue
 nceTh"><p>Info</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>linkType</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>LinkType</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - by default the value is LinkType.oneToOne - 
so you are not obliged to mention it</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Only one-to-one relation is 
allowed.</p></td></tr></tbody></table></div><p>e.g : If the model Class Client 
is linked to the Order class, then use annotation Link in the Order class like 
this :</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Property Link</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1)
@@ -167,15 +167,15 @@ public class Order {
     @Link
     private Client client;
 ...
-</pre>
+]]></script>
 </div></div><p>AND for the class Client :</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Class Link</b></div><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Link
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Link
 public class Client {
 ...
 }
-</pre>
-</div></div><h3 id="Bindy-3.DataField">3. DataField</h3><p>The DataField 
annotation defines the property of the field. Each datafield is identified by 
its position in the record, a type (string, int, date, ...) and optionally of a 
pattern</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Annotation name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Record type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>DataField</strong></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>all</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Property</p></td></tr></tbody></table></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Parameter name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>type</p></th><th colspan="
 1" rowspan="1" class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>pos</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - digit number starting from 1 to 
...</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>pattern</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "" - will be used to format 
Decimal, Date, ...</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>length</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - represents the length of the field for fixed 
length format</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>precision</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colsp
 an="1" rowspan="1" class="confluenceTd"><p>optional - represents the precision 
to be used when the Decimal number will be 
formatted/parsed</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>pattern</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "" - is used by the Java 
formatter (SimpleDateFormat by example) to format/validate data. If using 
pattern, then setting locale on bindy data format is recommended. Either set to 
a known locale such as "us" or use "default" to use platform default locale. 
Notice that "default" requires Camel 2.14/2.13.3/2.12.5.</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>position</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>optional - must be used when the position 
of the field in the CSV generated must be different compare to pos</p>
 </td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>required</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "false"</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>trim</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "false"</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>defaultValue</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>string</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> optional - 
default value = "" - defines the field's default value when the respective CSV 
field is empty/not available</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>impliedDecimalSeparator</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p><
 /td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 
2.11:</strong> optional - default value = "false" - Indicates if there is a 
decimal point implied at a specified location</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>lengthPos</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong>: optional - can be used to 
identify&#160;a data field in a fixed-length record that defines the fixed 
length for this field</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>delimiter</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11:</strong> optional - can be used to 
demarcate the end of a variable-length field within a fixed-length 
record</p></td></tr></tbody></table></div><p><strong>case 1 : 
pos</strong></p><p>This parameter/attribute represents the p
 osition of the field in the csv record</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Position</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+]]></script>
+</div></div><h3 id="Bindy-3.DataField">3. DataField</h3><p>The DataField 
annotation defines the property of the field. Each datafield is identified by 
its position in the record, a type (string, int, date, ...) and optionally of a 
pattern</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Annotation name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Record type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>DataField</strong></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>all</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Property</p></td></tr></tbody></table></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Parameter name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>type</p></th><th colspan="
 1" rowspan="1" class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>pos</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - The <strong>input</strong> position of the 
field. digit number starting from 1 to ... - See the position 
parameter.</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>pattern</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "" - will be used to format 
Decimal, Date, ...</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>length</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - represents the length of the field for fixed 
length format</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>precision</
 p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>optional - represents the 
precision to be used when the Decimal number will be 
formatted/parsed</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>pattern</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "" - is used by the Java 
formatter (SimpleDateFormat by example) to format/validate data. If using 
pattern, then setting locale on bindy data format is recommended. Either set to 
a known locale such as "us" or use "default" to use platform default locale. 
Notice that "default" requires Camel 2.14/2.13.3/2.12.5.</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>position</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>optional - must be used when the
  position of the field in the CSV generated (output message) must be different 
compare to input position (pos). See the pos parameter.</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>required</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>optional - default value = 
"false"</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>trim</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "false"</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>defaultValue</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>string</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> optional - 
default value = "" - defines the field's default value when the respective CSV 
field is empty/not available</p></td></tr><tr><td colspa
 n="1" rowspan="1" class="confluenceTd"><p>impliedDecimalSeparator</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> optional - 
default value = "false" - Indicates if there is a decimal point implied at a 
specified location</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>lengthPos</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong>: optional - can be used to 
identify&#160;a data field in a fixed-length record that defines the fixed 
length for this field</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>delimiter</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11:</strong> optional - can be used to 
demarcate the end of a variable-length field within
  a fixed-length record</p></td></tr></tbody></table></div><p><strong>case 1 : 
pos</strong></p><p>This parameter/attribute represents the position of the 
field in the csv record</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Position</b></div><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1)
@@ -186,9 +186,9 @@ public class Order {
 
 ...
 }
-</pre>
+]]></script>
 </div></div><p>As you can see in this example the position starts at '1' but 
continues at '5' in the class Order. The numbers from '2' to '4' are defined in 
the class Client (see here after).</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Position continues in another model 
class</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">public class Client {
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[public class Client {
 
     @DataField(pos = 2)
     private String clientNr;
@@ -200,9 +200,9 @@ public class Order {
     private String lastName;
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 2 : pattern</strong></p><p>The pattern allows to 
enrich or validates the format of your data</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Pattern</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1)
@@ -211,7 +211,7 @@ public class Order {
     @DataField(pos = 5)
     private String isinCode;
 
-    @DataField(name = "Name", pos = 6)
+    @DataField(name = &quot;Name&quot;, pos = 6)
     private String instrumentName;
 
     @DataField(pos = 7, precision = 2)
@@ -220,13 +220,13 @@ public class Order {
     @DataField(pos = 8)
     private String currency;
 
-    @DataField(pos = 9, pattern = "dd-MM-yyyy") -- pattern used during parsing 
or when the date is created
+    @DataField(pos = 9, pattern = &quot;dd-MM-yyyy&quot;) -- pattern used 
during parsing or when the date is created
     private Date orderDate;
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 3 : precision</strong></p><p>The precision is 
helpful when you want to define the decimal part of your number</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 1px;"><b>Precision</b></div><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1)
@@ -238,7 +238,7 @@ public class Order {
     @DataField(pos = 5)
     private String isinCode;
 
-    @DataField(name = "Name", pos = 6)
+    @DataField(name = &quot;Name&quot;, pos = 6)
     private String instrumentName;
 
     @DataField(pos = 7, precision = 2) -- precision
@@ -247,15 +247,15 @@ public class Order {
     @DataField(pos = 8)
     private String currency;
 
-    @DataField(pos = 9, pattern = "dd-MM-yyyy")
+    @DataField(pos = 9, pattern = &quot;dd-MM-yyyy&quot;)
     private Date orderDate;
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 4 : Position is different in 
output</strong></p><p>The position attribute will inform bindy how to place the 
field in the CSV record generated. By default, the position used corresponds to 
the position defined with the attribute 'pos'. If the position is different 
(that means that we have an asymetric processus comparing marshaling from 
unmarshaling) than we can use 'position' to indicate this.</p><p>Here is an 
example</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Position is different in output</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
-@CsvRecord(separator = ",", isOrdered = true)
+@CsvRecord(separator = &quot;,&quot;, isOrdered = true)
 public class Order {
 
     // Positions of the fields start from 1 and not from 0
@@ -279,9 +279,9 @@ public class Order {
     private String instrumentNumber;
 ...
 }
-</pre>
+]]></script>
 </div></div><div class="confluence-information-macro 
confluence-information-macro-note"><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>This attribute of the annotation 
@DataField must be used in combination with attribute isOrdered = true of the 
annotation @CsvRecord</p></div></div><p><strong>case 5 : 
required</strong></p><p>If a field is mandatory, simply use the attribute 
'required' setted to true</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Required</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1)
@@ -297,9 +297,9 @@ public class Order {
     private String lastName;
 ...
 }
-</pre>
+]]></script>
 </div></div><p>If this field is not present in the record, than an error will 
be raised by the parser with the following information :</p><p>Some fields are 
missing (optional or mandatory), line :</p><p><strong>case 6 : 
trim</strong></p><p>If a field has leading and/or trailing spaces which should 
be removed before they are processed, simply use the attribute 'trim' setted to 
true</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Trim</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1, trim = true)
@@ -315,9 +315,9 @@ public class Order {
     private String lastName;
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 7 : defaultValue</strong></p><p>If a field is not 
defined then uses the value indicated by the defaultValue attribute</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 1px;"><b>Default 
value</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator = ",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator = &quot;,&quot;)
 public class Order {
 
     @DataField(pos = 1)
@@ -329,13 +329,13 @@ public class Order {
     @DataField(pos = 3, required = true)
     private String firstName;
 
-    @DataField(pos = 4, defaultValue = "Barin")
+    @DataField(pos = 4, defaultValue = &quot;Barin&quot;)
     private String lastName;
 ...
 }
-</pre>
+]]></script>
 </div></div><div class="confluence-information-macro 
confluence-information-macro-note"><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>This attribute is only applicable 
to optional fields.</p></div></div><h3 id="Bindy-4.FixedLengthRecord">4. 
FixedLengthRecord</h3><p>The FixedLengthRecord annotation is used to identified 
the root class of the model. It represents a record = a line of a file/message 
containing data fixed length formatted and can be linked to several children 
model classes. This format is a bit particular beause data of a field can be 
aligned to the right or to the left.<br clear="none"> When the size of the data 
does not fill completely the length of the field, we can then add 'padd' 
characters.</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Annotation name</p></th><th colspan="1" rowspan="1" c
 lass="confluenceTh"><p>Record type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>FixedLengthRecord</strong></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>fixed</p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>Class</p></td></tr></tbody></table></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Parameter name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>crlf</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - possible values = WINDOWS,UNIX,MAC, or 
custom; default value = WINDOWS - allow to define the carriage return character 
to use. If you specify a value 
 other than the three listed before, the value you enter (custom) will be used 
as the CRLF character(s)</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>paddingChar</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>char</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - default value = ' '</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>length</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory = size of the fixed length 
record</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>hasHeader</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong> - optional - Indicates that 
the record(s) of this type may be preceded by a single header record at the 
beginning of the file / stream</p></td></tr><tr><td colspan="1" rowspan="
 1" class="confluenceTd"><p>hasFooter</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong> - optional - Indicates that 
the record(s) of this type may be followed by a single footer record at the end 
of the file / stream</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>skipHeader</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong> - optional - Configures the 
data format to skip marshalling / unmarshalling of the header record. Configure 
this parameter on the primary record (e.g., not the header or 
footer).</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>skipFooter</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong> - optional - Configures 
 the data format to skip marshalling / unmarshalling of the footer record 
Configure this parameter on the primary record (e.g., not the header or 
footer)..</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>isHeader</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong> - optional - Identifies 
this FixedLengthRecord as a header record</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>isFooter</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11</strong> - optional - Identifies 
this FixedLengthRecords as a footer record</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>ignoreTrailingChars</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11.1</st
 rong> - optional - Indicates that characters beyond the last mapped filed can 
be ignored when unmarshalling / parsing.</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>This annotation is associated to the root class of the 
model and must be declared one time.</p></td></tr></tbody></table></div><div 
class="confluence-information-macro confluence-information-macro-note"><span 
class="aui-icon aui-icon-small aui-iconfont-warning 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>The hasHeader/hasFooter parameters 
are mutually exclusive with isHeader/isFooter. A record may not be both a 
header/footer and a primary fixed-length record.</p></div></div><p><strong>case 
1 : Simple fixed length record</strong></p><p>This simple example shows how to 
design the model to parse/format a fixed message</p><p
 >10A9PaulineMISINXD12345678BUYShare2500.45USD01-08-2009</p><div class="code 
 >panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
 >style="border-bottom-width: 1px;"><b>Fixed-simple</b></div><div 
 >class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">   @FixedLengthRecord(length=54, paddingChar=' ')
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[   @FixedLengthRecord(length=54, 
paddingChar=&#39; &#39;)
     public static class Order {
 
         @DataField(pos = 1, length=2)
@@ -347,7 +347,7 @@ public class Order {
         @DataField(pos = 5, length=7)
         private String firstName;
 
-        @DataField(pos = 12, length=1, align="L")
+        @DataField(pos = 12, length=1, align=&quot;L&quot;)
         private String lastName;
 
         @DataField(pos = 13, length=4)
@@ -368,12 +368,12 @@ public class Order {
         @DataField(pos = 42, length=3)
         private String currency;
 
-        @DataField(pos = 45, length=10, pattern = "dd-MM-yyyy")
+        @DataField(pos = 45, length=10, pattern = &quot;dd-MM-yyyy&quot;)
         private Date orderDate;
         ...
-</pre>
+]]></script>
 </div></div><p><strong>case 2 : Fixed length record with alignment and 
padding</strong></p><p>This more elaborated example show how to define the 
alignment for a field and how to assign a padding character which is ' ' 
here''</p><p>10A9 PaulineM ISINXD12345678BUYShare2500.45USD01-08-2009</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 
1px;"><b>Fixed-padding-align</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">   @FixedLengthRecord(length=60, paddingChar=' ')
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[   @FixedLengthRecord(length=60, 
paddingChar=&#39; &#39;)
     public static class Order {
 
         @DataField(pos = 1, length=2)
@@ -385,7 +385,7 @@ public class Order {
         @DataField(pos = 5, length=9)
         private String firstName;
 
-        @DataField(pos = 14, length=5, align="L")   // align text to the LEFT 
zone of the block
+        @DataField(pos = 14, length=5, align=&quot;L&quot;)   // align text to 
the LEFT zone of the block
         private String lastName;
 
         @DataField(pos = 19, length=4)
@@ -406,12 +406,12 @@ public class Order {
         @DataField(pos = 48, length=3)
         private String currency;
 
-        @DataField(pos = 51, length=10, pattern = "dd-MM-yyyy")
+        @DataField(pos = 51, length=10, pattern = &quot;dd-MM-yyyy&quot;)
         private Date orderDate;
         ...
-</pre>
+]]></script>
 </div></div><p><strong>case 3 : Field padding</strong></p><p>Sometimes, the 
default padding defined for record cannnot be applied to the field as we have a 
number format where we would like to padd with '0' instead of ' '. In this 
case, you can use in the model the attribute paddingField to set this 
value.</p><p>10A9 PaulineM 
ISINXD12345678BUYShare000002500.45USD01-08-2009</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Fixed-padding-field</b></div><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">    @FixedLengthRecord(length = 65, paddingChar = ' ')
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[    @FixedLengthRecord(length = 65, 
paddingChar = &#39; &#39;)
     public static class Order {
 
         @DataField(pos = 1, length = 2)
@@ -423,7 +423,7 @@ public class Order {
         @DataField(pos = 5, length = 9)
         private String firstName;
 
-        @DataField(pos = 14, length = 5, align = "L")
+        @DataField(pos = 14, length = 5, align = &quot;L&quot;)
         private String lastName;
 
         @DataField(pos = 19, length = 4)
@@ -438,18 +438,18 @@ public class Order {
         @DataField(pos = 36, length = 5)
         private String instrumentType;
 
-        @DataField(pos = 41, precision = 2, length = 12, paddingChar = '0')
+        @DataField(pos = 41, precision = 2, length = 12, paddingChar = 
&#39;0&#39;)
         private BigDecimal amount;
 
         @DataField(pos = 53, length = 3)
         private String currency;
 
-        @DataField(pos = 56, length = 10, pattern = "dd-MM-yyyy")
+        @DataField(pos = 56, length = 10, pattern = &quot;dd-MM-yyyy&quot;)
         private Date orderDate;
         ...
-</pre>
+]]></script>
 </div></div><p><strong>case 4: Fixed length record with 
delimiter</strong></p><p>Fixed-length records sometimes have delimited content 
within the record. The firstName and lastName fields are delimited with the '^' 
character in the following 
example:</p><p>10A9Pauline^M^ISINXD12345678BUYShare000002500.45USD01-08-2009</p><div
 class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 
1px;"><b>Fixed-delimited</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">    @FixedLengthRecord()
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[    @FixedLengthRecord()
     public static class Order {
 
         @DataField(pos = 1, length = 2)
@@ -458,10 +458,10 @@ public class Order {
         @DataField(pos = 2, length = 2)
         private String clientNr;
 
-        @DataField(pos = 3, delimiter = "^")
+        @DataField(pos = 3, delimiter = &quot;^&quot;)
         private String firstName;
 
-        @DataField(pos = 4, delimiter = "^")
+        @DataField(pos = 4, delimiter = &quot;^&quot;)
         private String lastName;
 
         @DataField(pos = 5, length = 4)
@@ -476,17 +476,17 @@ public class Order {
         @DataField(pos = 8, length = 5)
         private String instrumentType;
 
-        @DataField(pos = 9, precision = 2, length = 12, paddingChar = '0')
+        @DataField(pos = 9, precision = 2, length = 12, paddingChar = 
&#39;0&#39;)
         private BigDecimal amount;
 
         @DataField(pos = 10, length = 3)
         private String currency;
 
-        @DataField(pos = 11, length = 10, pattern = "dd-MM-yyyy")
+        @DataField(pos = 11, length = 10, pattern = &quot;dd-MM-yyyy&quot;)
         private Date orderDate;
-</pre>
+]]></script>
 </div></div><div class="confluence-information-macro 
confluence-information-macro-note"><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>As of <strong>Camel 2.11</strong> 
the 'pos' value(s) in a fixed-length record may optionally be defined using 
ordinal, sequential values instead of precise column 
numbers.</p></div></div><p><strong>case 5 : Fixed length record with 
record-defined field length</strong></p><p>Occasionally a fixed-length record 
may contain a field that define the expected length of another field within the 
same record. In the following example the length of the instrumentNumber field 
value is defined by the value of instrumentNumberLen field in the 
record.</p><p>10A9Pauline^M^ISIN10XD12345678BUYShare000002500.45USD01-08-2009</p><div
 class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 1px;"><b>Fixed-delim
 ited</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">    @FixedLengthRecord()
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[    @FixedLengthRecord()
     public static class Order {
 
         @DataField(pos = 1, length = 2)
@@ -495,16 +495,16 @@ public class Order {
         @DataField(pos = 2, length = 2)
         private String clientNr;
 
-        @DataField(pos = 3, delimiter = "^")
+        @DataField(pos = 3, delimiter = &quot;^&quot;)
         private String firstName;
 
-        @DataField(pos = 4, delimiter = "^")
+        @DataField(pos = 4, delimiter = &quot;^&quot;)
         private String lastName;
 
         @DataField(pos = 5, length = 4)
         private String instrumentCode;
 
-        @DataField(pos = 6, length = 2, align = "R", paddingChar = '0')
+        @DataField(pos = 6, length = 2, align = &quot;R&quot;, paddingChar = 
&#39;0&#39;)
         private int instrumentNumberLen;
         
         @DataField(pos = 7, lengthPos=6)
@@ -516,17 +516,17 @@ public class Order {
         @DataField(pos = 9, length = 5)
         private String instrumentType;
 
-        @DataField(pos = 10, precision = 2, length = 12, paddingChar = '0')
+        @DataField(pos = 10, precision = 2, length = 12, paddingChar = 
&#39;0&#39;)
         private BigDecimal amount;
 
         @DataField(pos = 11, length = 3)
         private String currency;
 
-        @DataField(pos = 12, length = 10, pattern = "dd-MM-yyyy")
+        @DataField(pos = 12, length = 10, pattern = &quot;dd-MM-yyyy&quot;)
         private Date orderDate;
-</pre>
+]]></script>
 </div></div><p><strong>case 6 : Fixed length record with header and 
footer</strong></p><p>Bindy will discover fixed-length header and footer 
records that are configured as part of the model &#8211; provided that the 
annotated classes exist either in the same package as the primary 
@FixedLengthRecord class, or within one of the configured scan packages. The 
following text illustrates two fixed-length records that are bracketed by a 
header record and footer record.</p><p>101-08-2009<br clear="none"> 10A9 
PaulineM ISINXD12345678BUYShare000002500.45USD01-08-2009<br clear="none"> 10A9 
RichN ISINXD12345678BUYShare000002700.45USD01-08-2009<br clear="none"> 
9000000002</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Fixed-header-and-footer-main-class</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@FixedLengthRecord(hasHeader = true, hasFooter = true)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@FixedLengthRecord(hasHeader = true, 
hasFooter = true)
 public class Order {
 
     @DataField(pos = 1, length = 2)
@@ -538,7 +538,7 @@ public class Order {
     @DataField(pos = 3, length = 9)
     private String firstName;
 
-    @DataField(pos = 4, length = 5, align = "L")
+    @DataField(pos = 4, length = 5, align = &quot;L&quot;)
     private String lastName;
 
     @DataField(pos = 5, length = 4)
@@ -553,13 +553,13 @@ public class Order {
     @DataField(pos = 8, length = 5)
     private String instrumentType;
 
-    @DataField(pos = 9, precision = 2, length = 12, paddingChar = '0')
+    @DataField(pos = 9, precision = 2, length = 12, paddingChar = &#39;0&#39;)
     private BigDecimal amount;
 
     @DataField(pos = 10, length = 3)
     private String currency;
 
-    @DataField(pos = 11, length = 10, pattern = "dd-MM-yyyy")
+    @DataField(pos = 11, length = 10, pattern = &quot;dd-MM-yyyy&quot;)
     private Date orderDate;
 ...
 }
@@ -570,7 +570,7 @@ public  class OrderHeader {
     @DataField(pos = 1, length = 1)
     private int recordType = 1;
     
-    @DataField(pos = 2, length = 10, pattern = "dd-MM-yyyy")
+    @DataField(pos = 2, length = 10, pattern = &quot;dd-MM-yyyy&quot;)
     private Date recordDate;
     
 ...
@@ -583,15 +583,15 @@ public class OrderFooter {
     @DataField(pos = 1, length = 1)
     private int recordType = 9;
     
-    @DataField(pos = 2, length = 9, align = "R", paddingChar = '0')
+    @DataField(pos = 2, length = 9, align = &quot;R&quot;, paddingChar = 
&#39;0&#39;)
     private int numberOfRecordsInTheFile;
 
 ...
 }
 
-</pre>
+]]></script>
 </div></div><p><strong>case 7 : Skipping content when parsing a fixed length 
record. (Camel 2.11.1)</strong></p><p>It is common to integrate with systems 
that provide fixed-length records containing more information than needed for 
the target use case. It is useful in this situation to skip the declaration and 
parsing of those fields that we do not need. To accomodate this, Bindy will 
skip forward to the next mapped field within a record if the 'pos' value of the 
next declared field is beyond the cursor position of the last parsed field. 
Using absolute 'pos' locations for the fields of interest (instead of ordinal 
values) causes Bindy to skip content between two fields.</p><p>Similarly, it is 
possible that none of the content beyond some field is of interest. In this 
case, you can tell Bindy to skip parsing of everything beyond the last mapped 
field by setting the <strong>ignoreTrailingChars</strong> property on the 
@FixedLengthRecord declaration.</p><div class="code panel pdl" styl
 e="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@FixedLengthRecord(ignoreTrailingChars = true)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@FixedLengthRecord(ignoreTrailingChars = true)
 public static class Order {
 
         @DataField(pos = 1, length = 2)
@@ -603,15 +603,15 @@ public static class Order {
     ... any characters that appear beyond the last mapped field will be ignored
 
 }
-</pre>
+]]></script>
 </div></div><h3 id="Bindy-5.Message">5. Message</h3><p>The Message annotation 
is used to identified the class of your model who will contain key value pairs 
fields. This kind of format is used mainly in Financial Exchange Protocol 
Messages (FIX). Nevertheless, this annotation can be used for any other format 
where data are identified by keys. The key pair values are separated each other 
by a separator which can be a special character like a tab delimitor (unicode 
representation : \u0009) or a start of heading (unicode representation : 
\u0001)</p><div class="confluence-information-macro 
confluence-information-macro-note"><p class="title">"FIX information"</p><span 
class="aui-icon aui-icon-small aui-iconfont-warning 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>More information about FIX can be 
found on this web site : <a shape="rect" class="external-link" 
href="http://www.fixprotocol.org/"; 
rel="nofollow">http://www.fixprotocol.org/</a>. T
 o work with FIX messages, the model must contain a Header and Trailer classes 
linked to the root message class which could be a Order class. This is not 
mandatory but will be very helpful when you will use camel-bindy in combination 
with camel-fix which is a Fix gateway based on quickFix project <a shape="rect" 
class="external-link" href="http://www.quickfixj.org/"; 
rel="nofollow">http://www.quickfixj.org/</a>.</p></div></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Annotation name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Record type</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Message</strong></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>key value pair</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>Class</p></td></tr></tbody></table></div><div 
class="table-wrap"><t
 able class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Parameter name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>pairSeparator</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - can be '=' or ';' or 
'anything'</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>keyValuePairSeparair</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - can be '\u0001', '\u0009', '#' or 
'anything'</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>crlf</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - possible values = WI
 NDOWS,UNIX,MAC, or custom; default value = WINDOWS - allow to define the 
carriage return character to use. If you specify a value other than the three 
listed before, the value you enter (custom) will be used as the CRLF 
character(s)</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>type</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - define the type of message (e.g. FIX, EMX, 
...)</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>version</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - version of the message (e.g. 
4.1)</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>isOrdered</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = false - allow to chan
 ge the order of the fields when FIX message is generated</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>This annotation is associated to the message class of 
the model and must be declared one 
time.</p></td></tr></tbody></table></div><p><strong>case 1 : separator = 
'u0001'</strong></p><p>The separator used to segregate the key value pair 
fields in a FIX message is the ASCII '01' character or in unicode format 
'\u0001'. This character must be escaped a second time to avoid a java runtime 
error. Here is an example :</p><p>8=FIX.4.1 9=20 34=1 35=0 49=INVMGR 56=BRKR 
1=BE.CHM.001 11=CHM0001-01 22=4 ...</p><p>and how to use the annotation</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bottom-width: 1px;"><b>FIX - 
message</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Message(keyValuePairSeparator = "=", pairSeparator = 
"\u0001", type="FIX", version="4.1")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Message(keyValuePairSeparator = 
&quot;=&quot;, pairSeparator = &quot;\u0001&quot;, type=&quot;FIX&quot;, 
version=&quot;4.1&quot;)
 public class Order {
 ...
 }
-</pre>
+]]></script>
 </div></div><div class="confluence-information-macro 
confluence-information-macro-note"><p class="title">Look at test cases</p><span 
class="aui-icon aui-icon-small aui-iconfont-warning 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>The ASCII character like tab, ... 
cannot be displayed in WIKI page. So, have a look to the test case of 
camel-bindy to see exactly how the FIX message looks like 
(src\test\data\fix\fix.txt) and the Order, Trailer, Header classes 
(src\test\java\org\apache\camel\dataformat\bindy\model\fix\simple\Order.java)</p></div></div><h3
 id="Bindy-6.KeyValuePairField">6. KeyValuePairField</h3><p>The 
KeyValuePairField annotation defines the property of a key value pair field. 
Each KeyValuePairField is identified by a tag (= key) and its value associated, 
a type (string, int, date, ...), optionaly a pattern and if the field is 
required</p><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan
 ="1" class="confluenceTh"><p>Annotation name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Record type</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><strong>KeyValuePairField</strong></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Key Value Pair - 
FIX</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Property</p></td></tr></tbody></table></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Parameter name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>tag</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mandatory - digit number identifying the field in the 
message - m
 ust be unique</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>pattern</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - default value = "" - will be used to format 
Decimal, Date, ...</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>precision</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - digit number - represents the precision to 
be used when the Decimal number will be formatted/parsed</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>position</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>optional - must be used when the position 
of the key/tag in the FIX message must be different</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>required</p></td><td colsp
 an="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>optional - default value = 
"false"</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>impliedDecimalSeparator</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong>Camel 2.11:</strong> optional - default value = 
"false" - Indicates if there is a decimal point implied at a specified 
location</p></td></tr></tbody></table></div><p><strong>case 1 : 
tag</strong></p><p>This parameter represents the key of the field in the 
message</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>FIX 
message - Tag</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Message(keyValuePairSeparator = "=", pairSeparator = 
"\u0001", type="FIX", version="4.1")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Message(keyValuePairSeparator = 
&quot;=&quot;, pairSeparator = &quot;\u0001&quot;, type=&quot;FIX&quot;, 
version=&quot;4.1&quot;)
 public class Order {
 
     @Link Header header;
@@ -638,9 +638,9 @@ public class Order {
 
 ...
 }
-</pre>
+]]></script>
 </div></div><p><strong>case 2 : Different position in output</strong></p><p>If 
the tags/keys that we will put in the FIX message must be sorted according to a 
predefine order, then use the attribute 'position' of the annotation 
@KeyValuePairField</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>FIX message - Tag - sort</b></div><div class="codeContent panelContent 
pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Message(keyValuePairSeparator = "=", pairSeparator = 
"\\u0001", type = "FIX", version = "4.1", isOrdered = true)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Message(keyValuePairSeparator = 
&quot;=&quot;, pairSeparator = &quot;\\u0001&quot;, type = &quot;FIX&quot;, 
version = &quot;4.1&quot;, isOrdered = true)
 public class Order {
 
     @Link Header header;
@@ -655,9 +655,9 @@ public class Order {
 
 ...
 }
-</pre>
+]]></script>
 </div></div><h3 id="Bindy-7.Section">7. Section</h3><p>In FIX message of fixed 
length records, it is common to have different sections in the representation 
of the information : header, body and section. The purpose of the annotation 
@Section is to inform bindy about which class of the model represents the 
header (= section 1), body (= section 2) and footer (= section 3)</p><p>Only 
one attribute/parameter exists for this annotation.</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Annotation name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Record type</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Section</strong></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>FIX</p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>Class</p></td></tr></tbody></table></div><div 
class="table-wrap"><t
 able class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Parameter name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>number</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>digit number identifying the section 
position</p></td></tr></tbody></table></div><p><strong>case 1 : 
Section</strong></p><p>A. Definition of the header section</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>FIX message - Section - 
Header</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Section(number = 1)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Section(number = 1)
 public class Header {
 
     @KeyValuePairField(tag = 8, position = 1) // Message Header
@@ -667,10 +667,10 @@ public class Header {
     private int bodyLength;
 ...
 }
-</pre>
+]]></script>
 </div></div><p>B. Definition of the body section</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>FIX message - Section - Body</b></div><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Section(number = 2)
-@Message(keyValuePairSeparator = "=", pairSeparator = "\\u0001", type = "FIX", 
version = "4.1", isOrdered = true)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Section(number = 2)
+@Message(keyValuePairSeparator = &quot;=&quot;, pairSeparator = 
&quot;\\u0001&quot;, type = &quot;FIX&quot;, version = &quot;4.1&quot;, 
isOrdered = true)
 public class Order {
 
     @Link Header header;
@@ -682,9 +682,9 @@ public class Order {
 
     @KeyValuePairField(tag = 11, position = 3) // Order reference
     private String clOrdId;
-</pre>
+]]></script>
 </div></div><p>C. Definition of the footer section</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>FIX message - Section - 
Footer</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@Section(number = 3)
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@Section(number = 3)
 public class Trailer {
 
     @KeyValuePairField(tag = 10, position = 1)
@@ -694,9 +694,9 @@ public class Trailer {
     public int getCheckSum() {
         return checkSum;
     }
-</pre>
+]]></script>
 </div></div><h3 id="Bindy-8.OneToMany">8. OneToMany</h3><p>The purpose of the 
annotation @OneToMany is to allow to work with a List&lt;?&gt; field defined a 
POJO class or from a record containing repetitive groups.</p><div 
class="confluence-information-macro confluence-information-macro-note"><p 
class="title">Restrictions OneToMany</p><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>Be careful, the one to many of 
bindy does not allow to handle repetitions defined on several levels of the 
hierarchy</p></div></div><p>The relation OneToMany ONLY WORKS in the following 
cases :</p><ul class="alternate"><li>Reading a FIX message containing 
repetitive groups (= group of tags/keys)</li><li>Generating a CSV with 
repetitive data</li></ul><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Annotation name</p></th><th colspan="1" 
 rowspan="1" class="confluenceTh"><p>Record type</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Level</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>OneToMany</strong></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>all</p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p>property</p></td></tr></tbody></table></div><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Parameter name</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>type</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Info</p></th></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>mappedTo</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>string</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>optional - string - class name associated to the type 
of the List&lt;Type of the 
Class&gt;</p></td></tr></tbody></table></div><p><strong>case 1 : Gener
 ating CSV with repetitive data</strong></p><p>Here is the CSV output that we 
want :</p><p>Claus,Ibsen,Camel in Action 1,2010,35<br clear="none"> 
Claus,Ibsen,Camel in Action 2,2012,35<br clear="none"> Claus,Ibsen,Camel in 
Action 3,2013,35<br clear="none"> Claus,Ibsen,Camel in Action 
4,2014,35</p><p>Remark : the repetitive data concern the title of the book and 
its publication date while first, last name and age are common</p><p>and the 
classes used to modeling this. The Author class contains a List of 
Book.</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Generate CSV with repetitive data</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">@CsvRecord(separator=",")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[@CsvRecord(separator=&quot;,&quot;)
 public class Author {
 
        @DataField(pos = 1)
@@ -720,9 +720,9 @@ public class Book {
 
        @DataField(pos = 4)
        private String year;
-</pre>
+]]></script>
 </div></div><p>Very simple isn't it !!!</p><p><strong>case 2 : Reading FIX 
message containing group of tags/keys</strong></p><p>Here is the message that 
we would like to process in our model :</p><p>"8=FIX 
4.19=2034=135=049=INVMGR56=BRKR"<br clear="none"> 
"1=BE.CHM.00111=CHM0001-0158=this is a camel - bindy test"<br clear="none"> 
"22=448=BE000124567854=1"<br clear="none"> "22=548=BE000987654354=2"<br 
clear="none"> "22=648=BE000999999954=3"<br clear="none"> "10=220"</p><p>tags 
22, 48 and 54 are repeated</p><p>and the code</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Reading FIX message containing group of 
tags/keys</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">public class Order {
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[public class Order {
 
     @Link Header header;
 
@@ -737,7 +737,7 @@ public class Book {
     @KeyValuePairField(tag = 58) // Free text
     private String text;
 
-    @OneToMany(mappedTo = 
"org.apache.camel.dataformat.bindy.model.fix.complex.onetomany.Security")
+    @OneToMany(mappedTo = 
&quot;org.apache.camel.dataformat.bindy.model.fix.complex.onetomany.Security&quot;)
     List&lt;Security&gt; securities;
 ...
 
@@ -752,48 +752,48 @@ public class Security {
     @KeyValuePairField(tag = 54) // Movement type ( 1 = Buy, 2 = sell)
     private String side;
 
-</pre>
+]]></script>
 </div></div><h3 id="Bindy-UsingtheJavaDSL">Using the Java DSL</h3><p>The next 
step consists in instantiating the DataFormat <em>bindy</em> class associated 
with this record type and providing Java package name(s) as 
parameter.</p><p>For example the following uses the class 
<code>BindyCsvDataFormat</code> (who correspond to the class associated with 
the CSV record type) which is configured with "com.acme.model"<br clear="none"> 
package name to initialize the model objects configured in this 
package.</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">DataFormat bindy = new 
BindyCsvDataFormat("com.acme.model");
-</pre>
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[DataFormat bindy = new 
BindyCsvDataFormat(&quot;com.acme.model&quot;);
+]]></script>
 </div></div><h4 id="Bindy-Settinglocale">Setting locale</h4><p>Bindy supports 
configuring the locale on the dataformat, such as&#160;</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">BindyCsvDataFormat bindy = new 
BindyCsvDataFormat("com.acme.model");
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[BindyCsvDataFormat bindy = new 
BindyCsvDataFormat(&quot;com.acme.model&quot;);
 
-bindy.setLocale("us");</pre>
+bindy.setLocale(&quot;us&quot;);]]></script>
 </div></div><p>Or to use the platform default locale then use "default" as the 
locale name. Notice this requires Camel 2.14/2.13.3/2.12.5.</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">BindyCsvDataFormat bindy = new 
BindyCsvDataFormat("com.acme.model");
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[BindyCsvDataFormat bindy = new 
BindyCsvDataFormat(&quot;com.acme.model&quot;);
 
-bindy.setLocale("default");</pre>
+bindy.setLocale(&quot;default&quot;);]]></script>
 </div></div><p>for older releases you can set it using Java code as 
shown</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">BindyCsvDataFormat bindy = new 
BindyCsvDataFormat("com.acme.model");
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[BindyCsvDataFormat bindy = new 
BindyCsvDataFormat(&quot;com.acme.model&quot;);
 
-bindy.setLocale(Locale.getDefault().getISO3Country());</pre>
+bindy.setLocale(Locale.getDefault().getISO3Country());]]></script>
 </div></div><h4 id="Bindy-Unmarshaling">Unmarshaling</h4><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">from("file://inbox")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;file://inbox&quot;)
   .unmarshal(bindy)
-  .to("direct:handleOrders");
-</pre>
+  .to(&quot;direct:handleOrders&quot;);
+]]></script>
 </div></div><p>Alternatively, you can use a named reference to a data format 
which can then be defined in your <a shape="rect" 
href="registry.html">Registry</a> e.g. your <a shape="rect" 
href="spring.html">Spring</a> XML file:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">from("file://inbox")
-  .unmarshal("myBindyDataFormat")
-  .to("direct:handleOrders");
-</pre>
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;file://inbox&quot;)
+  .unmarshal(&quot;myBindyDataFormat&quot;)
+  .to(&quot;direct:handleOrders&quot;);
+]]></script>
 </div></div><p>The Camel route will pick-up files in the inbox directory, 
unmarshall CSV records into a collection of model objects and send the 
collection<br clear="none"> to the route referenced by 
'handleOrders'.</p><p>The collection returned is a <strong>List of Map</strong> 
objects. Each Map within the list contains the model objects that were 
marshalled out of each line of the CSV. The reason behind this is that <em>each 
line can correspond to more than one object</em>. This can be confusing when 
you simply expect one object to be returned per line.</p><p>Each object can be 
retrieve using its class name.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">    List&lt;Map&lt;String, Object&gt;&gt; 
unmarshaledModels = (List&lt;Map&lt;String, Object&gt;&gt;) 
exchange.getIn().getBody();
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[    List&lt;Map&lt;String, Object&gt;&gt; 
unmarshaledModels = (List&lt;Map&lt;String, Object&gt;&gt;) 
exchange.getIn().getBody();
 
     int modelCount = 0;
     for (Map&lt;String, Object&gt; model : unmarshaledModels) {
          for (String className : model.keySet()) {
             Object obj = model.get(className);
-            LOG.info("Count : " + modelCount + ", " + obj.toString());
+            LOG.info(&quot;Count : &quot; + modelCount + &quot;, &quot; + 
obj.toString());
          }
         modelCount++;
     }
 
-    LOG.info("Total CSV records received by the csv bean : " + modelCount);
-</pre>
+    LOG.info(&quot;Total CSV records received by the csv bean : &quot; + 
modelCount);
+]]></script>
 </div></div><p>Assuming that you want to extract a single Order object from 
this map for processing in a route, you could use a combination of a <a 
shape="rect" href="splitter.html">Splitter</a> and a <a shape="rect" 
href="processor.html">Processor</a> as per the following:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">from("file://inbox")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;file://inbox&quot;)
     .unmarshal(bindy)
     .split(body())
         .process(new Processor() {
@@ -803,16 +803,16 @@ bindy.setLocale(Locale.getDefault().getI
                 in.setBody(modelMap.get(Order.class.getCanonicalName()));
             }
         })
-        .to("direct:handleSingleOrder")
+        .to(&quot;direct:handleSingleOrder&quot;)
     .end();
-</pre>
+]]></script>
 </div></div><h4 id="Bindy-Marshaling">Marshaling</h4><p>To generate CSV 
records from a collection of model objects, you create the following route 
:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">from("direct:handleOrders")
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[from(&quot;direct:handleOrders&quot;)
    .marshal(bindy)
-   .to("file://outbox")
-</pre>
+   .to(&quot;file://outbox&quot;)
+]]></script>
 </div></div><h3 id="Bindy-Unittest">Unit test</h3><p>Here is two examples 
showing how to marshall or unmarshall a CSV file with Camel</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" 
style="border-bottom-width: 1px;"><b>Marshall</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package org.apache.camel.dataformat.bindy.csv;
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[package org.apache.camel.dataformat.bindy.csv;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -837,16 +837,16 @@ import org.springframework.config.java.t
 import org.springframework.test.context.ContextConfiguration;
 import 
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
 
-@ContextConfiguration(locations = 
"org.apache.camel.dataformat.bindy.csv.BindyComplexCsvMarshallTest$ContextConfig",
 loader = JavaConfigContextLoader.class)
+@ContextConfiguration(locations = 
&quot;org.apache.camel.dataformat.bindy.csv.BindyComplexCsvMarshallTest$ContextConfig&quot;,
 loader = JavaConfigContextLoader.class)
 public class BindyComplexCsvMarshallTest extends 
AbstractJUnit4SpringContextTests {
 
     private List&lt;Map&lt;String, Object&gt;&gt; models = new 
ArrayList&lt;Map&lt;String, Object&gt;&gt;();
-    private String result = "10,A1,Julia,Roberts,BE123456789,Belgium Ventage 
10/12,150,USD,14-01-2009";
+    private String result = &quot;10,A1,Julia,Roberts,BE123456789,Belgium 
Ventage 10/12,150,USD,14-01-2009&quot;;
 
-    @Produce(uri = "direct:start")
+    @Produce(uri = &quot;direct:start&quot;)
     private ProducerTemplate template;
 
-    @EndpointInject(uri = "mock:result")
+    @EndpointInject(uri = &quot;mock:result&quot;)
     private MockEndpoint resultEndpoint;
 
     @Test
@@ -863,19 +863,19 @@ public class BindyComplexCsvMarshallTest
 
         Order order = new Order();
         order.setOrderNr(10);
-        order.setAmount(new BigDecimal("150"));
-        order.setIsinCode("BE123456789");
-        order.setInstrumentName("Belgium Ventage 10/12");
-        order.setCurrency("USD");
+        order.setAmount(new BigDecimal(&quot;150&quot;));
+        order.setIsinCode(&quot;BE123456789&quot;);
+        order.setInstrumentName(&quot;Belgium Ventage 10/12&quot;);
+        order.setCurrency(&quot;USD&quot;);
 
         Calendar calendar = new GregorianCalendar();
         calendar.set(2009, 0, 14);
         order.setOrderDate(calendar.getTime());
 
         Client client = new Client();
-        client.setClientNr("A1");
-        client.setFirstName("Julia");
-        client.setLastName("Roberts");
+        client.setClientNr(&quot;A1&quot;);
+        client.setFirstName(&quot;Julia&quot;);
+        client.setLastName(&quot;Roberts&quot;);
 
         order.setClient(client);
 
@@ -889,7 +889,7 @@ public class BindyComplexCsvMarshallTest
 
     @Configuration
     public static class ContextConfig extends SingleRouteCamelConfiguration {
-        BindyCsvDataFormat camelDataFormat = new 
BindyCsvDataFormat("org.apache.camel.dataformat.bindy.model.complex.twoclassesandonelink");
+        BindyCsvDataFormat camelDataFormat = new 
BindyCsvDataFormat(&quot;org.apache.camel.dataformat.bindy.model.complex.twoclassesandonelink&quot;);
 
         @Override
         @Bean
@@ -897,16 +897,16 @@ public class BindyComplexCsvMarshallTest
             return new RouteBuilder() {
                 @Override
                 public void configure() {
-                    
from("direct:start").marshal(camelDataFormat).to("mock:result");
+                    
from(&quot;direct:start&quot;).marshal(camelDataFormat).to(&quot;mock:result&quot;);
                 }
             };
         }
     }
 
 }
-</pre>
+]]></script>
 </div></div><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeHeader panelHeader pdl" style="border-bottom-width: 
1px;"><b>Unmarshall</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">package org.apache.camel.dataformat.bindy.csv;
+<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[package org.apache.camel.dataformat.bindy.csv;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
@@ -919,10 +919,10 @@ import org.springframework.config.java.t
 import org.springframework.test.context.ContextConfiguration;
 import 
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
 
-@ContextConfiguration(locations = 
"org.apache.camel.dataformat.bindy.csv.BindyComplexCsvUnmarshallTest$ContextConfig",
 loader = JavaConfigContextLoader.class)
+@ContextConfiguration(locations = 
&quot;org.apache.camel.dataformat.bindy.csv.BindyComplexCsvUnmarshallTest$ContextConfig&quot;,
 loader = JavaConfigContextLoader.class)
 public class BindyComplexCsvUnmarshallTest extends 
AbstractJUnit4SpringContextTests {
 
-    @EndpointInject(uri = "mock:result")
+    @EndpointInject(uri = &quot;mock:result&quot;)
     private MockEndpoint resultEndpoint;
 
     @Test
@@ -933,7 +933,7 @@ public class BindyComplexCsvUnmarshallTe
 
     @Configuration
     public static class ContextConfig extends SingleRouteCamelConfiguration {
-        BindyCsvDataFormat csvBindyDataFormat = new 
BindyCsvDataFormat("org.apache.camel.dataformat.bindy.model.complex.twoclassesandonelink");

[... 131 lines stripped ...]

Reply via email to