Settings

Theme

Having Fun with Java Reflection and Modules

blog.ptidej.net

6 points by yann-gael 4 months ago · 1 comment

Reader

yann-gaelOP 4 months ago

Java modules offer strong(er) encapsulation and put the onus on the Java programs to explicitly declare, at compile-time and run-time, whether they need special access to APIs (i.e., packages and their classes) hidden in some specific modules. These special accesses can be declared at both compile and run times and, of course, must be documented along with the programs. However, at run time, you may still want to hide some APIs that are not (yet) in a module, and conversely, you may still want to access hidden APIs and inform the program users that they forgot to allow this access. You can do both in pure Java by having some fun with reflection!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection