javadoc用法

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

我们知道Java中有三种注释语句:

1.//用于单行注释。

2./*...*/用于多行注释,从/*开始,到*/结束,不能嵌套。

3./**...*/则是为支持jdk工具javadoc.exe而特有的注释语句。

javadoc 工具能从java源文件中读取第三种注释,并能识别注释中用@标识的一些特殊变量(见表),制作成Html格式的类说明文档。javadoc不但能对一个 java源文件生成注释文档,而且能对目录和包生成交叉链接的html格式的类说明文档,十分方便。

注释中可以出现的关键字,以@开头:

@author 作者名

@version 版本标识

@parameter 参数名及其意义

@since 最早出现的JDK版本

@return 返回值

@throws 异常类及抛出条件

@deprecated 引起不推荐使用的警告

@see 交叉参考

下面是javadoc.exe的用法

C:\java>javadoc -help

C:\java>javadoc -help

usage: javadoc [options] [packagenames] [sourcefiles] [classnames] [@ files]

-overview Read overview documentation from HTML file -public Show only public classes and members

-protected Show protected/public classes and members ( default)

-package Show package/protected/public classes and m embers

-private Show all classes and members

-help Display command line options and exit

-doclet Generate output via alternate doclet

-docletpath Specify where to find doclet class files -sourcepath Specify where to find source files

-classpath Specify where to find user class files

-exclude Specify a list of packages to exclude

-subpackages Specify subpackages to recursively load

-breakiterator Compute 1st sentence with BreakIterator

-bootclasspath Override location of class files loaded by the bootstrap class loader

-source Provide source compatibility with specified release

-extdirs Override location of installed extensions -verbose Output messages about what Javadoc is doing -locale Locale to be used, e.g. en_US or en_US_WIN -encoding Source file encoding name

-J Pass directly to the runtime system

Provided by Standard doclet:

-d Destination directory for output fi les

-use Create class and package usage page

s

-version Include @version paragraphs

-author Include @author paragraphs

-docfilessubdirs Recursively copy doc-file subdirect ories

-splitindex Split index into one file per lette

r

-windowtitle Browser window title for the docume nation

-doctitle Include title for the overview page -header Include header text for each page -footer Include footer text for each page -bottom Include bottom text for each page -link Create links to javadoc output at < url>

-linkoffline Link to docs at using package list at

-excludedocfilessubdir :.. Exclude any doc-files subdirectorie

s with given name.

-group :.. Group specified packages together i n overviewpage

-nocomment Supress description and tags, gener ate only declarations.

-nodeprecated Do not include @deprecated informat ion

-noqualifier ::... Exclude the list of qualifiers from the output.

-nosince Do not include @since information -nodeprecatedlist Do not generate deprecated list

-notree Do not generate class hierarchy

-noindex Do not generate index

-nohelp Do not generate help link

相关文档
最新文档