JAutodoc - Eclipse Plugin

JAutodoc - Eclipse Plugin

JAutodoc is an Eclipse Plugin for automatic adding Javadoc and file headers to your source code. It optionally generates initial comments from element name. Starting with Release 1.3 of JAutodoc it is possible to define Velocity templates for Javadoc and file headers.

Features

JAutodoc has the following features:

Mode
Complete existing Javadoc
Existing Javadoc will not be touched. Only missing tags will be added and so far undocumented elements will be documented. Keep existing Javadoc
Existing Javadoc will not be touched. Missing tags will not be added, but so far undocumented elements will be documented. Replace existing Javadoc
Existing Javadoc will be totally replaced by the generated Javadoc. Be sure, if you use this option.
Visibility
Public, protected, package or private
Decide for which visibilities you like to create Javadoc.
Filter
Comment Types, Fields, Methods or Getter/Setter only
Decide for which kind of members you like to create Javadoc.
Options
Add ToDo for auto-generated Javadoc
Add ToDo flag in order to find all sources with auto-generated Javadoc. This is done once only for a source file.

Create comment from element name
With this option checked JAutodoc will generate comments from element name as shown below. Templates can be used, to define how this comments will be created. Additionally for fields, methods and parameters shortcut Replacements can be defined.

Fields:

Methods:

Single line field comment
Option to create single line field comments.

Use Eclipse comment formatter
Use Eclipse internal formatter to format the generated comments. The format can be defined under the preferences of

File Header
  • Add/Replace file header
    You can specify a file header that will be added to your source, if no header exists. Optionally, existing headers can be replaced. With option Multi comment header checked, multiple comments at the beginning of the source can be replaced.

    Inside header text the Velocity Template Language (VTL ) and pre-defined Variables can be used.

    Note: In order to use dollar signs inside the header template (e.g. for SVN/CVS properties like $id$) you have to escpape these signs by an backslash (\$).
Package Javadoc
  • Edit Template
    You can specify the initial content of the package.html , which can be added via context menu of package nodes in the Package Explorer .

    Like for headers the Velocity Template Language (VTL ) and pre-defined Variables can be used inside the template.

Replacements
When creating comments from element name, shortcuts inside of fields, methods and parameters can be replaced by another text. For example "set" will be replaced by "Sets the" or "db" can be expanded to "Database".

These replacements can be added, deleted or changed via the preferences . The scope of an replacement can be "Field", "Method" or "Both". Use "Field" for fields and parameters. Optionally only the prefix (Prefix) or every occurrence (All) of the shortcut can be replaced.

Note: Shortcuts are case insensitive. They are detected by changes between upper and lower case letters inside the element name (e.g. setDbName).


Usage

For source files opened in Editor Javadoc can be added for all or only for selected members. In this case the modified source file will not be saved automatically to disk.

If the cursor is inside the declaration of an field or method, only this element will be documented. To create a type comment point to the name of the type. Otherwise all members of the current source file will be documented.

Selecting the menus with "..." will open an options dialog where it's possible to overrule the current project/workspace settings. This settings will only be effective for the current compilation unit and only for this Eclipse session.

In Package Explorer you can select one or more source file(s) in order to add Javadoc. Alternatively, you can select a package and add Javadoc for all package members or you can do it for the complete project.

Caution: Source files which are not opened in the editor will be saved directly to disk.

Changes

2007-09-09 Version 1.5.0 Enhanced prefix/keyword replacement. Escaping of dollar signs in templates by \$ Support for Package Javadoc. 2007-07-10 Version 1.4.0 Project specific settings. Temporary settings for single compilation units. Ant task for Eclipse. Support for multi comment headers. General improvements for Eclipse 3.3 2007-05-01 Version 1.3.0
  • Using Velocity templates for Header and Javadoc.
  • Template variables (e.g. $user, $date, $project_name, ...)
  • Context menu for adding Header only.
  • Filter options for Types, Fields, Methods and Getter/Setter.
  • Corrected order of parameter documentation.
  • Improvement for non-Javadoc.
  • Support for {@inheritDoc}.
  • New Update Site http://jautodoc.sourceforge.net/update/
2007-01-05: Version 1.2.0
  • Consider member visibility.
  • Use non-Javadoc for inherited methods.
  • Editor shortcut Ctrl-Alt-J.
  • Selection model in editor changed.
  • Prefix replacement for fields and parameters.
2006-10-20: Version 1.1.0
  • Single line field comments.
  • Use Eclipse comment formatter.
  • Add/Replace file header.
2006-08-20: Version 1.0.0
  • Initial version.

License

JAutodoc is licensed under the Eclipse Public License - v 1.0

Starting with Release 1.3 JAutodoc comes with the Velocity Template Engine 1.5, which is available under the Apache Software License - v 2.0



Download and Installation

Download JAutodoc here and unzip the file to the Eclipse directory or use the Update Site

http://jautodoc.sourceforge.net/update/

Note: Update from 1.3.0 to 1.4.0 using the Update Site doesn't work correctly. You have to select "Help->Software Updates->Find and Install...->Search for new features to install" to get the new version.


3.更新插件成功点击 window -> preferences->java->javadoc
4.File Header 选中add file header,点击 edit 按钮输入:
  /**
 * Copyright (c ) 2010 Founder International Co. Ltd & JetStream
 *
 * All rights reserved.
 *
 */
5.点击Javadoc->Templates :Types ->Default ->Edit:
  添加  
   @author JiDong Zhang
   @version 1.0
 等等其它信息:
6.在你要添加的class 上右击-JAutodoc->Add javadoc/Add header



Contact

JAutodoc is written by Martin Kesting .
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值