Print header separately
Brought to you by:
aruckerjones,
sconway
Hi,
First of all, let me thank you for your work here. This lib is really good, easy to use and quite self explained!
However, in my specific case, I would like to be able to print headers at need.
Do you think it would be possible to add this functionality in a next release?
If you want, I can help with your guidance.
Thanks in advance
Hello Six
All mapping strategies have a generateHeader that creates the header as a array of Strings. It can be called at will.
If that does not work for you then please explain your use case with some sample code.
Scott :)
Hello Scott,
In deed, this a possibility but I don't see why an existing bean is required to export the header?
I believe its a chicken and egg thing. The bean is probably the best way to get all the fields and annotations. Though if we were to ever try a ground up rewrite we might try and use the class first.
Nope. I went back and checked the code, or rather my javadoc, to refresh my memory. The reason an actual bean is necessary is because of the joining and splitting functionality we added a few years ago. Any fields joined on reading and split on writing are represented as a MultiValuedMap, with the exact column names in the index of the map. These names, as in the documented example, might be "Track1," "Track2," "Track3," and so on. These column names do not exist in the class. They only exist in an instantiated bean that has been properly filled.