0

I would get all fields set in projections interfaces. When I use getDeclaredFields on a class it's ok, but on projection interface return an empty list. Do you know a way to get them?

1 Answers1

0

The interface itself doesn't have any fields because it's basically a thing that declares for you some possibillity, i.e. what can be done using it, so there is no any info about fields. But you can use intrf.getClass().getInterfaces() instead to take a list of interfaces related to your object. Then iterate through it and invoke a getDeclaredMethods() for a desired interface

Yuriy Tsarkov
  • 2,461
  • 2
  • 14
  • 28