As we learn more, we all want to encapsulate our own APIs, but it is not easy for new users!
What I want to achieve: encapsulate some methods, export the jar package, add it to other projects, and there will be comments!
1. encapsulate your own Api. This step is very simple. Just write it yourself!
2. export javadoc. This step is also very simple: export, java, javadoc. In the javadoc command, select C: \ Program Files \ Java \ jdk1.7.0 _ 45 \ bin \ javadoc.exe, the specific path depends on your own!
After export, there will be an additional doc directory in the project, which is the help document!
3. Export the jar package, similar to 2, but select javadoc instead of jar file! Export!
Usage:
1. Copy It To The libs directory of the corresponding project, add it to the Java Build Path, and then expand it, as shown in:
Here, my jar package is: MyApi. jar expand, select Javadoc location, and click Edit on the right. The pop-up window is as follows:
Select Javadoc in archive, select Workspace file, and select jar package in Archive path! Path within archive refers to the Path of the doc directory in the jar package! Select it!
OK, just enjoy it!