Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put java package-level information to use by javadoc?

Some API docs contain information at package level. For example java.io contains 3 package-level sections here http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html

The sections are: "Package java.io Description", "Package Specification" and "Related Documentation".

Where should I put these sections content in my own project so that javadoc processes it in the same way?

like image 776
Suzan Cioc Avatar asked Oct 15 '12 14:10

Suzan Cioc


3 Answers

create a file called package-info.java in each package

inside do the following

/**
 * Javadoc
 */
package my.cool.package123;
like image 64
peshkira Avatar answered Nov 03 '22 23:11

peshkira


You put those comments in a package comment file (emphasis mine):

Each package can have its own documentation comment, contained in its own "source" file, that the Javadoc tool will merge into the package summary page that it generates. You typically include in this comment any documentation that applies to the entire package.

To create a package comment file, you have a choice of two files to place your comments:

  • package-info.java - Can contain a package declaration, package annotations, package comments and Javadoc tags. This file is generally preferred over package.html .
  • package.html - Can contain only package comments and Javadoc tags, no package annotations.
like image 27
Joachim Sauer Avatar answered Nov 03 '22 23:11

Joachim Sauer


You have to put a file called package-info.java into the folder that contains your package.

like image 45
Pao Avatar answered Nov 03 '22 22:11

Pao