How to use jdok


JDOK helps to document Java classes, interfaces and methods.

Installation

Put jdok.el on your Emacs load-path and add (require 'jdok) into your Emacs startup file.

Usage

The jdok-generate-javadoc-template command inserts a javadoc block comment template above the class or method declaration at point. The command assumes that the declaration syntax is valid.

  BEFORE EXECUTING THE COMMAND, THE POINT MUST BE LOCATED AT THE FIRST LINE OF THE CLASS, INTERFACE OR METHOD DECLARATION. IF NOT RESULT IS UNCERTAIN.

In the following examples, point (-|-) is located at the beginning of the line, before the word public (but it could be anywhere on this line):

1- Class example:

-|- public class MyClass
      extends MySuperClass implements Runnable, java.io.Serializable
    {
      ...

M-x jdok-generate-javadoc-template inserts:

+   /**
+    * Describe class 'MyClass' here.
+    *
+    * @author "David Ponce" <david.ponce@wanadoo.fr>
+    * @version 1.0
+    * @since 1.0
+    * @see MySuperClass
+    * @see Runnable
+    * @see java.io.Serializable
+    */
    public class MyClass
      extends MySuperClass implements Runnable, java.io.Serializable
    {
      ...

2- Method example:

-|- public
    void myMethod( int x, int y )
      throws Exception
    {
      ...

M-x jdok-generate-javadoc-template inserts:

+   /**
+    * Describe 'myMethod' method here.
+    *
+    * @param x a value of type 'int'
+    * @param y a value of type 'int'
+    * @exception Exception if an error occurs
+    */
    public
    void myMethod( int x, int y )
      throws Exception
    {
      ...

Customization

Use M-x jdok-customize (or M-x customize-group RET jdok) to customize jdok options.

You can customize each category of javadoc comment line (description, @version, @return, ...).


Copyright © 1998, 2000 David Ponce Last updated on 2000-04-21