Retrieve field values using BeanUtils

TheLameProgrammer picture TheLameProgrammer · May 25, 2011 · Viewed 15.7k times · Source

I want to extract private field values that are not marked by certain custom annotation, is this possible via BeanUtils? If yes, how?

Answer

MarcoS picture MarcoS · May 25, 2011

Yes, assuming that you know the fields names. You can use PropertyUtils.getSimpleProperty(...). See also here for an example.