camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Magnus Palmér <magnus.palmer.w...@gmail.com>
Subject Re: Bindy fixed length
Date Wed, 17 Apr 2013 19:52:11 GMT
There are examples of how to do it on the Bindy documentation page:
http://camel.apache.org/bindy.html

Look for the @Link


2013/4/17 fbarbat <fbarbat@gmail.com>

> Sorry, after I wrote the post I felt it wasn't clear enough too...
> I wanted to ask if there was a feature to similar to Hibernate's components
> (or BeanIO segments) to break the bean into a root bean and smaller nested
> beans.
>
> For example, let's suppose I have this line:
> NAME------LAST_NAME-ADDRESS---ZIP_CODE--
>
> We could model this line as a POJO called Person, and it would be something
> like this:
>
> @FixedLengthRecord
> class Person{
> @DataField(pos=1, length=10)
> private String name;
> @DataField(pos=2, length=10)
> private String lastName;
> @DataField(pos=3, length=10)
> private String address;
> @DataField(pos=4, length=10)
> private String zipCode;
>
> //Getters and setters...
> }
>
> Now, if the amount of fields grows too much, I would like to split this
> object into several nested objects. For example, now I want to have two
> objects:
>
> //Nested bean, relative to the position specified in parent bean
> @FixedLengthRecord
> class Address{
> @DataField(pos=1, length=10)
> private String address;
> @DataField(pos=2, length=10)
> private String zipCode;
>
> //Getters and setters...
> }
>
> //Root bean
> @FixedLengthRecord
> class Person {
> @DataField(pos=1, length=10)
> private String name;
> @DataField(pos=2, length=10)
> private String lastName;
> @DataField(pos=3, length=10)
> private Address address;
>
> //Getters and setters
> }
>
> I tried to find a feature like this in Bindy but I couldn't find one. As a
> workaround, I switched to BeanIO for marshalling/unmarshalling this way.
> Anyway, I would have liked to use annotations instead of the BeanIO XML
> file.
>
> Thanks,.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731037.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message