Michał Zegan
2018-07-21 15:43:51 UTC
Hello,
If I use reflection, I can access every member of every package in a
module if a module opens such package, and that includes private members.
What, however, about using method handles for that purpose?
Also, if you have a class in module a that wants to deserialize data to
objects of classes in module b, then should module b open a package with
those classes to a, or maybe, give the deserializer it's lookup object,
in order for it to be able to access members of non exported non opened
packages? It is for the case where the deserializer is called by the
module b. Also I assume that I do not need access to non public members
of classes, like I deserialize using public setters always.
If I use reflection, I can access every member of every package in a
module if a module opens such package, and that includes private members.
What, however, about using method handles for that purpose?
Also, if you have a class in module a that wants to deserialize data to
objects of classes in module b, then should module b open a package with
those classes to a, or maybe, give the deserializer it's lookup object,
in order for it to be able to access members of non exported non opened
packages? It is for the case where the deserializer is called by the
module b. Also I assume that I do not need access to non public members
of classes, like I deserialize using public setters always.