eclipse get set 自动添加注释

首先我们先导入 注释模板

http://blog.****.net/xu511739113/article/details/53021233

设置后getters 和 setters

eclipse get set 自动添加注释

eclipse get set 自动添加注释

之后需要我们替换eclipse安装文件中GetterSetterUtil.class  

先下载GetterSetterUtil.class文件

https://download.****.net/download/lililidahaoren/10604583

之后替换 GetterSetterUtil.class 文件,注意 替换的时候必须关闭 eclipse 

用 WinRAR 打开 eclipse/plugins/org.eclipse.jdt.ui_*.jar

替换 org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil类

之后启动eclipse

 

 

 
  1. /** 用户id */

  2. private String id;

  3.  
  4. /** 用户名称 */

  5. private String name;

  6.  
  7. /**

  8. * 返回 用户id

  9. *

  10. * @return 用户id

  11. */

  12. public String getId() {

  13. return id;

  14. }

  15.  
  16. /**

  17. * 设置 用户id

  18. *

  19. * @param id

  20. * 用户id

  21. */

  22. public void setId(String id) {

  23. this.id = id;

  24. }

  25.  
  26. /**

  27. * 返回 用户名称

  28. *

  29. * @return 用户名称

  30. */

  31. public String getName() {

  32. return name;

  33. }

  34.  
  35. /**

  36. * 设置 用户名称

  37. *

  38. * @param name

  39. * 用户名称

  40. */

  41. public void setName(String name) {

  42. this.name = name;

  43. }


当我们生成get set 方法的时候 会自动添加注释