Set annotations for automatically adding Get,set comments to field properties in Eclipse

Source: Internet
Author: User

One: Description

First of all, look at what the effect is, it may be clearer

is to automatically add attribute comments in Get/set, so how do we configure it?

Two: Configuration 2.1: Download attachments

Download attachments

2.2: Replace Class

The original eclipse is not able to achieve this effect, we need to modify the inside of the jar package.

We found the Eclipse directory and then, using the Windows-brought search tool, the search for org.eclipse.jdt.ui_*.jar,* represents the version number.

Let's make a copy, back it up, and avoid the modification failure.

Close Eclipse.

Open the jar with the compression software, Find the Org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil.class, and then download the attachment, the attachment contains the class and source code, if the compilation of the wrong version, you can choose to compile your own, the class Replace the class inside the jar package.

2.3: Set Eclipse

Restart Eclipse Settings Annotation style:

Window->preferences->java->codestyle->code templates->comments->getters/setters

Get

/**   * Get ${bare_field_name}   * @return ${bare_field_name} ${bare_field_name} * *     

Set

/**   * Set ${bare_field_name}   * @param ${bare_field_name} ${bare_field_name} * *     

Then, when the Get/set method is generated, a note is automatically generated in the hook

And then we can.

Set annotations for automatically adding Get,set comments to field properties in Eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.