title: segment terminator in BeanIO
body: <p>I'm interested in the recordTerminator parser property of BeanIO. Does it apply to segments too, like "segmentTerminator"? Namely, I have a stream of fixedlength format, containing of a single record with repeatable segments, and all stream is a single line. Hence, I have set recordTerminator="", but it still gives me </p>
  
  <pre><code>==&gt; Invalid 'state':  Expected minimum 1 occurrences
  ==&gt; Invalid 'city':  Expected minimum 1 occurrences
  ==&gt; Invalid 'street':  Invalid field length, expected 35 characters
  ==&gt; Invalid 'zip':  Expected minimum 1 occurrences
  </code></pre>
  
  <p>It doesn't complain about fields that precede to repeatable segment, and complaints about the fields in a repeatable segment are out of order defined in mapping.xml, that looks like this:</p>
  
  <pre><code>    &lt;beanio  xmlns="http://www.beanio.org/2012/03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd"&gt;
        &lt;stream name="employeeFile" format="fixedlength"&gt;
          &lt;parser&gt;
              &lt;property name="recordTerminator" value="" /&gt;
          &lt;/parser&gt;  
          &lt;record name="employee" class="example.Employee"&gt;
            &lt;field name="firstName" length="35" /&gt;
            &lt;field name="lastName" length="35" /&gt;
            &lt;field name="title" length="35" /&gt;
            &lt;field name="salary" length="35" /&gt;
            &lt;segment name="addressList" collection="list" minOccurs="1" maxOccurs="unbounded" class="example.Address"&gt;
              &lt;field name="street" length="35" /&gt;
              &lt;field name="city" length="35" /&gt;
              &lt;field name="state" length="35" /&gt;      
              &lt;field name="zip" length="10" /&gt;
            &lt;/segment&gt;
          &lt;/record&gt; 
        &lt;/stream&gt;
      &lt;/beanio&gt;
  </code></pre>
  
  <p>Class implementations is like this:</p>
  
  <pre><code>    package example;        
      public class Employee {
          String firstName;
          String lastName;
          String title;
          String salary;
          List&lt;Address&gt; addressList;
  
          // getters and setters not shown...
      }       
  
      package example;
      public class Address {
          private String street;
          private String city;
          private String state;
          private String zip;
  
          // getters and setters not shown...
      }       
  </code></pre>
  
  <p>If I remove all preceding fields to repetitive segment both from mapping.xml and the input string, remaining string is properly unmarshalled, and marshalled to json afterwards, I even didn't change implementation of java classes, so the preceding fields stay uninitialized, as expected, but properly printed out after marshalling. Where did I go wrong?</p>
  
  <p>OK, my camel code is in spring xml, looks like this:</p>
  
  <pre><code>    &lt;route id="simple-route"&gt;
          &lt;!-- from id="request-file" uri="file://C:/mqdocuments/?fileName=response464.txt"/--&gt;
          &lt;from id="request-file" uri="file://C:/mqdocuments/?fileName=request464.txt"/&gt;
          &lt;log id="route-log-request" message="request: ${body}"/&gt;
          &lt;setHeader headerName="CamelJmsDestinationName" id="_setHeader1"&gt;
              &lt;constant&gt;queue://QM_TEST/INPUTQ?targetClient=1&lt;/constant&gt;
          &lt;/setHeader&gt;
          &lt;to id="_to1" pattern="InOut" uri="websphere:queue:SYSTEM.DEFAULT.LOCAL.QUEUE?useMessageIDAsCorrelationID=true&amp;amp;replyTo=REPLYQ"/&gt;
          &lt;log id="route-log-response" message="response: ${body}"/&gt;
                      &lt;transform&gt;
                          &lt;simple&gt;${body}\0&lt;/simple&gt;
                  &lt;/transform&gt;
          &lt;unmarshal ref="parseTransactions464"/&gt;
          &lt;marshal ref="jack"/&gt;
          &lt;log id="route-log-json" message="jackson: ${body}"/&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>So basically, when I uncomment input from file, in which the reponse is saved, and place in comment mq to endpoint, unmarshalling is OK, but if I put a request to a queue, and get response, then I hope to rectify the problem by a transform that simply adds EOF character, because without it, it gives me error that I reported in the first place.
  And transform doesn't help, because I don't know how to write EOF (ascii 26), but even if I figure that out, I'm not sure it will help.</p>