I am working in a Spring project and I need to access every property of a given POJO to receive it's name. Right now I am using Java reflection and it is working exactly how I expect it to behave, but I am not sure about it being a smart solution. Another problem using Reflection is that the properties are private so I would have to use field.setAccessibility(true) for every field, which I guess is not a elegant solution, even though only the Field instance is changed. Maybe someone can provide me more information about this use case.
Greetings
Used Java Reflection and it worked but I don't know if it's the best solution. Maybe someone can provide me more detailed information about this use case
Aucun commentaire:
Enregistrer un commentaire