Hiding classes in a jar file

前端 未结 8 1591
渐次进展
渐次进展 2020-12-06 02:20

Is it really impossible to hide some classes in a jar file?

I wanted not to allow direct instantiation of the classes to keep it more flexible. Only the factory (or

相关标签:
8条回答
  • 2020-12-06 02:59

    With standard classloaders and plain old jar files, this is not possible. OSGi has this concept of making visible only some packages to another bundle(i.e. separation of public api and internal implementation).

    If you are using eclipse, you may enforce such rules with this

    0 讨论(0)
  • 2020-12-06 03:02

    Obfuscation can help you somehow.

    0 讨论(0)
提交回复
热议问题