Eclipse generating method headers

Is there any way I can generate method headers in eclipse?

For example: if I already have a method in my code:

public void doSomething(String name,String age){
}

Expected OP

 /*
    *This method does something
    *@param name  name of employee
    *@param age  age of employee
    */
    public void doSomething(String name,String age){

    }
+5
source share
3 answers

A type

/**
Enter

After that, Eclipse will create a default java document for you.

+9
source

There are several ways to do this:

  • Use the Shift+ Alt+ J, when your cursor is anywhere in your technique or method header
  • Use Rightclick -> Source -> Generate Element Commentto create Javadoc comments in the editor window.

The templates for these comments can be customized in the settings template section: Window -> Preferencesand thenJava -> Code Style -> Code Templates

+7
source

RIGHT CLICK β†’ Source β†’ Generate Element Comment

Shift + Alt + J

+2
source

All Articles