Open GoogleCodeExporter opened 9 years ago
Hmm, "format" shouldn't be used outside of your own TypeHandler. Can you
pinpoint where that is happening? Or share the custom type handler you wrote
(or a simplified version that recreates the issue)?
Original comment by kevin.s...@gmail.com
on 20 Aug 2014 at 4:05
There's a lot going on in my type handler (and current version nuked this code
because I had to find another way to make it work) but I've cleaned it up and
re-coded in how I was doing it as reference.
The symptoms when BeanIO parses the file are that the Read of the record fails
validation with the format explicitly specified in the error as "S000000000"
where the format that is being passed to the handler is provably "000000000" so
my only guess as to why the parser would even be aware of the original
un-truncated form "S000000000" is that the format attribute is being read by
other than my newInstance code.
Original comment by omnipit...@gmail.com
on 20 Aug 2014 at 4:48
It sounds like your type handler is not being properly registered, can you
share your mapping file?
Original comment by kevin.s...@gmail.com
on 26 Aug 2014 at 2:46
I've attached the mapping (once again simplified but all the important bits are
there). I know the handler is being registered at least somewhat because
logging I have in my handler is how I've been debugging this. I may be missing
some facet though... Thanks!
Original comment by omnipit...@gmail.com
on 26 Aug 2014 at 3:44
Can you attach a simple and complete example that recreates the issue?
I can't make any sense of the code you've already posted for two reasons:
1. You aren't setting a format attribute on the field in the mapping file,
which I thought was your original issue.
2. The TypeHandler you posted instantiates another TypeHandler implementation
that you haven't shared.
Original comment by kevin.s...@gmail.com
on 28 Aug 2014 at 3:07
I've attached a modified version of the mapping with apologies that the format
attribute got stripped. I've also attached the simple Bean to store the data as
well as a file of sample data.
As for point 2: Which 'other' TypeHandler are you referring to? Both
TypeHandlers referenced in my TypeHandler (BigDecimalTypeHandler and
ConfigurableTypeHandler) were written by you.
Original comment by omnipit...@gmail.com
on 2 Sep 2014 at 10:33
Attachments:
CustomFormatBigDecimalTypeHandler.newInstance() is creating a type handler
called 'HardSignedBigDecimalMovablePointHandler', for which you have not
included the source. I would much prefer if you could provide a simpler
implementation that recreates the issue. Thanks!
Original comment by kevin.s...@gmail.com
on 6 Sep 2014 at 2:34
Fixed that for you...
Original comment by omnipit...@gmail.com
on 8 Sep 2014 at 4:39
Attachments:
Original issue reported on code.google.com by
omnipit...@gmail.com
on 18 Aug 2014 at 4:09