Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javadoc parameter without package name

Tags:

javadoc

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.

like image 687
user1418973 Avatar asked May 26 '12 12:05

user1418973


2 Answers

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.

like image 96
Paŭlo Ebermann Avatar answered Dec 29 '22 12:12

Paŭlo Ebermann


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

like image 34
Daniel Vimont Avatar answered Dec 29 '22 12:12

Daniel Vimont