user1053279
user1053279

Reputation: 95

generating method headers in eclipse

Is there any way by which i can generate method headers in eclipse?

Eg: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){

    }

Upvotes: 5

Views: 7072

Answers (3)

Eng.Fouad
Eng.Fouad

Reputation: 117685

RIGHT CLICK --> Source --> Generate Element Comment

or just click on Shift + Alt + J

Upvotes: 2

Matt
Matt

Reputation: 17649

There are several ways to do this:

  • Use the Shift + Alt + J when your cursor is anywhere within your method or on the method header
  • Use Rightclick -> Source -> Generate Element Comment to generate Javadoc comments in your editor window

The templates for these comments can be customized in the template section of the preferences: Window -> Preferences and then Java -> Code Style -> Code Templates

Upvotes: 7

Udo Held
Udo Held

Reputation: 12548

Type

/**
Enter

Afterwards Eclipse will generate you a default java-doc.

Upvotes: 9

Related Questions