I'm working on a library that uses reflection, and I would like to manipulate all the properties / function of a given KClass.
Using the KClass::members
property, I can manipulate all the accessible members (as per the documentation), ie: the public, internal and protected fields, properties and functions. But I can't see the private ones.
Using Java reflection, I can see all fields (inluding private ones) using the Class.getDeclaredFields()
, and likewise I can see private methods using Class.getDeclaredMethods()
.
Is there a way to do this using the kotlin reflection API ?