-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for inherited fields #45
Comments
Inherited methods work. Try the following example:
You are having trouble because your classes are not public and the parser can't instantiate them. |
Jeronimo, thanks for your prompt reply. I took your sample, copied it to a file and ran the code. I got:
As for my original code, I had only provided a quick sample, not the actual classes. Actual classes are all public. You can download the full sample project from http://www.filedropper.com/csv-mapping_1 and run it with Maven as |
See line 75 in BeanConversionProcessor in release 1.5.6 and compare it with the code on the That explains why the released code does not pick up inherited fields. Most likely, your sample must have been run against the |
Thanks Manish. You are correct. Use version 2.0.0-SNAPSHOT to get this fixed. We'll release the final 2.0.0 version within a month or so. |
Cool, I am grateful for having stumbled across this library. I am using it in a web app that supports uploading .xls and .csv files. The difference in performance between .xls and .csv parsing is absolutely mind-blowing, and our advanced users who upload .csv files are patently thrilled. Is it possible for you to release an intermediate version (may be 1.5.7) with just this fix? Our CSV upload feature is currently in limited beta and users are baying to release it across the application. Getting a fix will allow us to release CSV uploads to a wider audience. |
For more immediate needs, we offer paid support and will take care of your problem straight away. |
Jeronimo, do you have a release date for 2.0.0? |
Will be around January, 2016. We are working on a lot of stuff that integrates with univocity-parsers-2.0.0 and some development is still to be made on it. |
I have a class hierarchy such as the following:
When I use
BeanListProcessor
with aCsvParser
, the parser fails to read both the fields from the parent class (Named
). I can see that this is because of the lineField[] declared = clazz.getDeclaredFields();
in theinitialize
method of theBeanConversionProcessor
class. Due to this line, the CSV parsing code only considers fields declared immediately inside the class being parsed.I am not sure if this is intended. I certainly feel this behaviour is incorrect as we cannot use class inheritance if inherited fields cannot be read by the parser.
Is there a way to read inherited fields? If not, can this be added?
The text was updated successfully, but these errors were encountered: