When coding and writing entity classes, I found that an entity class has many fields to be annotated. They are all private and cannot be accessed directly. The documentation comments we added when writing did not work, but the automatically generated get , the documentation comments of the set method do not meet our requirements (the documentation comments in the fields are not included), so it is very tangled. I saw some great gods on the Internet and have a solution, just try it out, take it out and share it with everyone!
Modified renderings:
step:
1: Search for org.eclipse.jdt.ui_*.jar in myeclipse/eclisp (* is the version number)
2: Change the jar file to .rar format and open it (it is best to back up the jar file before modifying)
3: Find the file GetterSetterUtil.class in the directory \org\eclipse\jdt\internal\corext\codemanipulation, download address http://download.csdn.net/detail/ydcun/5521921
4: Open the development tools and find Window->Preferences->Java->CodeStyle->Code Templates->Comments->Getters/Setters
getters:
- /**
- * get ${bare_field_name}
- * @return ${bare_field_name} ${bare_field_name}
- */
- /**
- * set ${bare_field_name}
- * @param ${bare_field_name} ${bare_field_name}
- */
Note: Check Generate method comments when generating Get/Set methods
When coding and writing entity classes, I found that an entity class has many fields to be annotated. They are all private and cannot be accessed directly. The documentation comments we added when writing did not work, but the automatically generated get , the documentation comments of the set method do not meet our requirements (the documentation comments in the fields are not included), so it is very tangled. I saw some great gods on the Internet and have a solution, just try it out, take it out and share it with everyone!
Modified renderings:
step:
1: Search for org.eclipse.jdt.ui_*.jar in myeclipse/eclisp (* is the version number)
2: Change the jar file to .rar format and open it (it is best to back up the jar file before modifying)
3: Find the file GetterSetterUtil.class in the directory \org\eclipse\jdt\internal\corext\codemanipulation, download address http://download.csdn.net/detail/ydcun/5521921
4: Open the development tools and find Window->Preferences->Java->CodeStyle->Code Templates->Comments->Getters/Setters
getters:
- /**
- * get ${bare_field_name}
- * @return ${bare_field_name} ${bare_field_name}
- */
- /**
- * set ${bare_field_name}
- * @param ${bare_field_name} ${bare_field_name}
- */
Note: Check Generate method comments when generating Get/Set methods