我正在Eclipse上的Java开发,我有一个API,我想与我的其他开发人员分享。为了保护代码,我想导出/删除我所有eclipse方法的内容。
我只想留下声明。
我有很多文件和方法,所以我想知道是否没有程序/插件可以帮我做到这一点。
发布于 2018-06-17 10:01:23
完全不清楚你想要做什么。
如果您(字面上)想要“清理”您的类并为人们提供框架,那么:
- Give people the compiled code (don't obfuscate it!) and they can discover the API's using an IDE. Depending on the compilation flags, you may lose the names of method parameters. Make sure you compile with maximal "debug" information.
- Generate and provide javadocs. This will provide people the same information as your "stripped" source code.
另一方面,如果您的真正目标是提供一个其他人可以实现的API,那么正确的方法是使用接口而不是类来定义API。Eclipse确实支持这一点。有一些标准的Eclipse重构可以从现有Java class
的源代码中提取Java interface
。
https://stackoverflow.com/questions/50892111
复制相似问题