如何处理骆驼案例的Eclipse模板? [英] How to deal with Camel Case for Eclipse Templates?
问题描述
private $ {type} $ {field};
private $ {type} get $ {field}(){return $ {field};}
private void设置$ {field}($ {type} $ {field}){this。$ {field} = $ {field};}
<有什么技巧呢?我知道Eclipse可以为我生成getter和setter,但是#1:它是菜单驱动(慢),#2:它不是我想要的格式。
谢谢!
最好你现在可以做的是
private $ {Type} $ {field};
private $ {Type} get $ {Field}(){return $ {field};}
private void set $ {Field}($ {Type} $ { field}){this。$ {field} = $ {field};}
您可以在自定义插件中定义VariableResolver来执行此操作
I'm trying to write an Eclipse template which will create getters and setters when I create an attribute. My current template works, except for the camel casing for the getters and setters.
private ${type} ${field};
private ${type} get${field}() {return ${field};}
private void set${field}(${type} ${field}) {this.${field} = ${field};}
Any tricks to do so? I am aware that Eclipse can generate the getters and setters for me, but #1: it's menu driven (slow), #2: it's not in the format I want.
Thanks!
Best you can do right now is
private ${Type} ${field};
private ${Type} get${Field}() {return ${field};}
private void set${Field}(${Type} ${field}) {this.${field} = ${field};}
This defines separate linked variables for the upper and lower case names.
You may be able to define a VariableResolver in a custom plugin to do this
这篇关于如何处理骆驼案例的Eclipse模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!