mardi 11 octobre 2016

Skip "this$0" field during field iteration in Spring ReflectionUtils

I'm using Spring ReflectionUtils to iterate over all fields of a class. The problem is that the target class is an inner class, so it contains "invisible" reference to the parent class called "this$0". And I'm wondering: what is the proper way to skip such field, because I don't want to process it? I think filtering by name ("this$0") is a bad approach, so I hope there's a better solution.

P.S. Also, AFAIK, there might be more than one such field if we have more than one outer class.





Aucun commentaire:

Enregistrer un commentaire