0

I have created a library. Actually, it is a Wrapper of another library. So, i want to restrict the developer who uses my library to see the classes of the internal library which i have used. Developer shouldn't know the internal library which i have used.

For Example: Lets say "X" is my library And say "Y" is another library.

So, in my library "X" i have used library "Y".

People who use my library(i.e., X) should not see the classes of library "Y" .

  • By definition, that is not possible, insofar as the classes of Y will be in their app. – CommonsWare May 30 '17 at 12:17
  • @CommonsWare classes of Y will be in library X. App uses classes X. Yes, Of course internally classes of Y being used by X. But app should not see the classes of Y thereby, and package name also. – Anju Chowdary May 30 '17 at 12:26
  • Again, that is not possible. There is no notion in Java of having classes that do not exist ("should not see") but actually do exist ("being used"). – CommonsWare May 30 '17 at 12:30

1 Answers1

0

If you're publishing

  • your code, there is no way to hide it.
  • the .jar file, the final modifier keeps people from extending classes and Using those methods, and use the private modifier for everything, except interfaces.

Otherwise use OSGi

There are many similiar question asked on SO:

1 and 2

Zallentine
  • 36
  • 4