I'm writing an SDK in Java and I don't want every class to be accessible for the user to use.
Making the class package-private doesn't help because I have hundreds of classes that I want to order in different packages.
Is there any way to restrict a class access for users who use my code as a library? Or maybe make the IDE warn the user when he tries to use specific classes in the library?
Thanks!
EDIT: I just want the user to know somehow that a class is internal and is not supposed to be used by him. Documenting the class isn't enough.
If you have Java 9 at least, You can use Modules from JSR-376 standard. It's JPMS (Java Platform Module System). 
Package-private feature could be not enough for SKD, because Users can avoid this access type by reflection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With