Eclipse automatically generates comments

Source: Internet
Author: User

Create a codetemplates. xml file with the content

<? Xml version = "1.0" encoding = "UTF-8"?> <Templates> <template autoinsert = "false" context = "settercomment_context" deleted = "false" description = "Comment for setter method" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. settercomment "name =" settercomment "> /**
* @ Param $ {param}: set the property $ {bare_field_name }.
*/</Template> <template autoinsert = "false" context = "filecomment_context" deleted = "false" description = "Comment for created Java files" enabled = "true" id =" org. eclipse. jdt. ui. text. codetemplates. filecomment "name =" filecomment "> /**
* @ Title $ {file_name}
* @ Package $ {package_name}
* @ Description: describe what the file is created in one sentence.
* @ Author Tian qiongbo
* @ Update $ {date }$ {time}
* @ Version V1.0
*/</Template> <template autoinsert = "false" context = "delegatecomment_context" deleted = "false" description = "Comment for delegate methods" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. delegatecomment "name =" delegatecomment "> /**
* $ {Tags}
* $ {See_to_target}
*/</Template> <template autoinsert = "false" context = "typecomment_context" deleted = "false" description = "Comment for created types" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. typecomment "name =" typecomment "> /**
* @ Description the role of this class is described in one sentence.
* @ Version 1.0
* @ Author Tian qiongbo
* @ Update $ {date }$ {time}
*/

</Template> <template autoinsert = "false" context = "overridecomment_context" deleted = "false" description = "Comment for overriding methods" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. overridecomment "name =" overridecomment ">/* (non-Javadoc)
* $ {See_to_overridden}
*/</Template> <template autoinsert = "false" context = "fieldcomment_context" deleted = "false" description = "Comment for fields" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. fieldcomment "name =" fieldcomment "> /**
* @ Fields $ {field}
*/
</Template> <template autoinsert = "false" context = "methodcomment_context" deleted = "false" description = "Comment for non-overriding methods" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. methodcomment "name =" methodcomment "> /**
* $ {Tags}
* @ Description: Describe the method in one sentence.
* @ Version 1.0
* @ Author Tian qiongbo
* @ Update $ {date }$ {time}
*/</Template> <template autoinsert = "false" context = "gettercomment_context" deleted = "false" description = "Comment for getter method" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. gettercomment "name =" gettercomment "> /**
* @ Return $ {bare_field_name}: return the property $ {bare_field_name }.
*/</Template> <template autoinsert = "false" context = "constructorcomment_context" deleted = "false" description = "Comment for created constructors" enabled = "true" id = "org. eclipse. jdt. ui. text. codetemplates. constructorcomment "name =" constructorcomment "> /**
* Class Constructor
* $ {Tags}
*/</Template> </templates>

Import the file in code Comments under window-> java-> code style-> Code templates.

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.