Hi Kevin,
Thanks for the reply.
I agree that it could become cumbersome. I still think that this is counterbalanced by the inline validation, that is not possible using an XML mapping file. Any typos or errors in the XML will only show when using that particular portion of the stream. Quite a few frameworks use annotations. Taking JPA as an example, I define the @Column of JPA and the @Field of BeanIO directly above each other, so I can immediately see if there are differences in length for example. When combining this with multiple streams, I have everything together. Any changes are done together.
Based on your remarks I did some research on using multiple annotations. The option was introduced in Java 8:
http://docs.oracle.com/javase/tutorial/java/annotations/repeating.htmlThere seems to be another option, which is discussed here:
http://stackoverflow.com/questions/1554112/multiple-annotations-of-the-same-type-on-one-elementCopy-paste of the relevant section:
public @interface Foos {
Foo[] value();
}
@Foos({@Foo(bar="one"), @Foo(bar="two")})
public void haha() {}
Can you tell if this would work for BeanIO? It seems to match the code in Fields.class and Field.class.
I will see how far I can get and post back if something interesting comes up. I have no idea how to implement the rest, but it will be somewhere on Google :)
Thanks for the framework and the time you invest in it, I learn a lot this way.