Skip to content
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

Inheritence support in getPojoFields or another method #80

Closed
drdamour opened this issue Apr 9, 2016 · 5 comments
Closed

Inheritence support in getPojoFields or another method #80

drdamour opened this issue Apr 9, 2016 · 5 comments

Comments

@drdamour
Copy link

drdamour commented Apr 9, 2016

I was surprised getPojoFields didn't return inherited fields. I've been using this helper method to get all fields, even those inherited.

public static Map<PojoField, PojoClass> getAllFieldsIncludingInherited(PojoClass pojoClass){
        Map<PojoField, PojoClass> fields = new HashMap<PojoField, PojoClass>();

        PojoClass c = pojoClass;

        while(c != null){
            for(PojoField field : c.getPojoFields()){
                fields.put(field, c);
            }

            c = c.getSuperClass();
        }

        return fields;
    }

The map is because i need the PojoClass to getClazz().getDeclaredField(PojoField.getName()) in order to get a handle to the getters and setters method (using method factory). This wouldn't be necessary if #79 was implemented.

@oshoukry
Copy link
Member

Closing issue as issue #79 has already been implemented.
Please feel free to update if further assistance on this is required.

@drdamour
Copy link
Author

drdamour commented May 30, 2017

all that 79 does is make the map not necessary as the return type (can now just return the methods)...there still needs to be a way to get all inherited fields with getPojoFields in my opinion...can you please reopen?

@oshoukry
Copy link
Member

Thank you for your timely response, I'll open an issue specifically to get all inherited fields as a separate enhancement as this issue mentions that #79 makes it not necessary.

@drdamour
Copy link
Author

it makes returning a map not necessary..the issue is still the issue

@oshoukry
Copy link
Member

See issue #101 please feel free to comment on that regarding enhancing the PojoClass to get all fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants