|
[
Permlink
| « Hide
]
Dave Syer added a comment - 11/Jan/08 12:27 PM
It wouldn't be a big change, but it wasn't planned. We use JIRA for planning, so this ticket can now be folded into a plan (it probably won't be in 1.0, but maybe a point release 1.0.1, unless someone contributes some code).
Been sitting on this one for awhile...
Attached a modification that preserves the original behavior (with slight rename of setters to "setDefaultXXX" instead of "setXXX") and adds the ability to inject maps from FieldSet name to align / padding -- or, in the case where your field set does not have a name, allows you to address your ranges by index (e.g. 0 = first range, 1 = second range, etc.). The added logic does not seem to have a noticable performance impact. Hope this solves the issue adequately. Updated attachments to allow for values in padding map to be non-character - new behavior converts to string and asserts that length is 1, then converts to character - added a regression condition test to one of the test cases
Sorry, last upload named the files the same so they're indistinguishable by name alone - use the attached "v2" versions. I don't have rights so please delete the duplicates.
We should follow a system like the logback formatting scheme:
http://logback.qos.ch/manual/layouts.html See format modifiers I raised the priority on this, as I think it absolutely needs to be done for 1.1
I'm not sure what we can do in 1.1. The FieldSet is created by the application, not the framework, so all the conversion and formatting has already been done before we get any data to write out in the aggregator. So the FieldSetCreator should handle zero padding of numbers (the aggregator can't tell the difference between field types). It's sort of uncomfortable because it seems like the file output concerns should be more separate from the object mapping concerns, but they aren't. This is basically because of our design of the LineAggregator using FieldSet and FieldSetCreator. I can't see a good way to fix this without redesigning the aggregation and conversion, so I would prefer to leave it for now.
The workaround shouldn't be too painful in 1.x - you (the application programmer) just have to know the width of the numeric columns so you can add the zero padding in the FieldSetCreator. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||