I'm brand new on using BeanIO 2.1 and I'm again facing an issue.
I'm trying to decode a fixed-length file, which has some records spread on several lines, where the 'rid' is only marked on the first of these lines
Example:
:10:BLABLABLABLA
:11:/TRTP/SEPA OVERBOEKING/IBAN
HR W HERMAN
503270327C30,49NTRFSCT20111212
:12:BLABLABLABLA
As you can see, the record ':11:' is spread over 3 lines. I'd like to grab these lines as a List of String, where the rid ':11:' would just be ignored.
This is the mapping.xml file:
<record name="ownerInformation" order="2" class="com.batch.records.OwnerInformation" minOccurs="1" maxOccurs="6" collection="list">
<field name="tag" type="string" length="4" rid="true" literal=":11:" ignore="true" />
<field name="description" type="string" length="unbounded" maxLength="65" />
</record>
As a result, the exception UnexpectedRecordException:
org.beanio.UnexpectedRecordException: End of stream reached, expected record 'ownerInformation'
Thanks again for helping me
It is possible to Map Bean Objects that Span Multiple Records.
You will have to create record IDs for each of the lines, for example: I'm using commans to delimit fields.
Something like this:
This will map to an
OwnerInformationlike this: