I searched for the answer for several months and I tried several things, including unpacking the compressed src.zip folder and using it as a parameter for Javadoc (for example: javadoc -sourcepath src com.example.test )
This is the default Javadoc that ships with the JDK 6 Update 24.
Let's say that I'm working on a new map that implements the java.util.Map interface. By default, the methods that I override from the map interface should inherit the documentation from the interface, if I'm not mistaken. However, javadoc never does this.
The only thing so far working on this problem was actually javadoc-ing classes written by Java (for example: javadoc com.example.text java.util ). I do not want to do this because it seems to me that I have rewritten Java classes, but is this the only way to do this? If I believe that I could just live with him, but I realized that there is another way to do this.
Thanks =) Sorry if this is a little dirty. This is my first time using Stack Overflow. I'm also sorry if this question has already been asked. I read a lot of similar questions, they do not cover everything that I wanted to ask, and I found them very confusing because they are related to writing my own implementation of Javadoc. Anyway, thank you in advanced =)
Edit: May 25 at 4:44 am
Everything is correct =) If I understood correctly, you would like to see an example. This is a simpler example that I tried to see if it was because I tried something that should not work.
package com.example; public class UpperCaseObject { @Override public int hashCode() { return super.hashcode(); } @Override public String toString() { return super.toString().toUpperCase(); } }
I moved this example (file name UpperCaseObject.java ) to the javadoc-test/com/example directory, and also created another javadoc-test/java/lang directory by placing Object.java (from src.zip) in it.
The javadoc call I made was javadoc -link http://download.oracle.com/javase/6/docs/api/ com.example from the javadoc-test directory. I have a jdk6 bin directory in my path parameter.
The two things I expected were for UpperCaseObject.hashCode to inherit all the documentation and UpperCaseObject.toString all the way up to the extra paragraph from java.lang.Object . However, unfortunately, I did not receive any documentation.
Edit:
Well, I needed to do the following. This is an easy workaround.
- I copied all the source files from source.zip, as you usually did.
- I also made package files for each package. They contain the first paragraph (the one that contains the resume) and the second paragraph that says: "See the " Package Summary "in the Java ™ Edition 6 API for more information."
- The source files were, in fact, superclasses, their superclasses (and interfaces), and any exceptions that they threw, which were also in the same package. The one exception was java.lang, where I only needed to get an Object. Exceptions were also needed because, apart from java.lang, no other packages were bound if the exception was in the same package as the throwing class.
- I javadoc'd all the packages that I used / subclassing / exception -throwing.
- I will definitely include some information about standard packages and my own package in its overview file.
Unfortunately, now I can only work, but I am convinced that this may be a problem with my version of Java. It seems that other people had a similar problem and they came up with their workarounds. This is just my own =)
I will still answer, but this is the most convenient option. Thank you very much!