9

Basically, eclipse export javadoc output format such as:

    Method
    Modifier and type        Method and description
    java.lang.String         getData(java.lang.String key)
    java.lang.String         echo(java.lang.String string) 
    ...

If i wanna another format such as:

    Method
    Modifier and type        Method and description
    String                   getData(String key)
    String                   echo(String string) 
    ...

(without package name)

what should i do in the eclipse javadoc Extra javadoc options item? many thanks.

4

3 回答 3

14

I'm not sure how one does configure this in Eclipse, but the standard doclet has the -noqualifier option.

If you don't want any package names to be shown, you can use -noqualifier all, if you only want some package names to be omitted, you can list these, like this: -noqualifier java.lang:java.io.

Note then in these cases it is a good idea to also have a -link or -linkoffline option linking to the documentation of these classes, so readers have a chance to find out which class is meant here.

于 2012-05-28T18:54:26.953 回答
1

For those using Maven (and the maven-javadoc-plugin), here is an example of specifying "noqualifier" and "links" for the javadocs plugin (within the project's pom.xml file).

<build>
  <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <configuration>
          <noqualifier>all</noqualifier>
          <links>
            <link>http://hbase.apache.org/apidocs/</link>
            <link>http://docs.oracle.com/javase/7/docs/api/</link>
          </links>
        </configuration>
        <executions>
          <execution>
            <id>javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
  </plugins>
</build>

Documentation on the "noqualifier" parameter is very succinct, and can be found here: https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#noqualifier

Full documentation on the "links" parameter is available here: https://maven.apache.org/plugins/maven-javadoc-plugin/examples/links-configuration.html

于 2016-04-25T09:24:29.320 回答
0

For Ant you can also remove qualifiers from package names when using Ant's javadoc task to define javadoc output via build.xml.

noqualifier is an attribute of <javadoc> that takes either "all" or a colon-separated list of qualifiers to remove. Here is an example,

An Ant build.xml example line that removes Javadoc qualifiers from java.lang, java.io, and java.util will look something like this:

<javadoc sourcepath="${src.dir}" destdir="${doc.dir}"
         classpathref="compile.classpath" access="public"
         noqualifier="java.lang:java.io:java.util"/>
于 2018-09-20T21:03:09.257 回答