日食中奇怪的自动生成的吸气剂和食物 [英] Strange autogenerated getter and setter in eclipse
问题描述
当我在Eclipse中为getter / setter自动生成一个类名称为
String lAttr
的类字段时,它将产生:
When I use the auto generation for getter/setter in Eclipse for an class field with a name like
String lAttr
it will produce this:
public String getlAttr() {
return lAttr;
}
public void setlAttr(String lAttr) {
this.lAttr = lAttr;
}
字段的第一个字母不会被大写!但是我使用的一些框架,通过使用get+大写字段名称来反思并调用getter / setter。
The first letter of the field will not be capitalized! But some frameworks which I use, work with reflection and invoke the getter/setter by using the "get" + capitalized field name.
我可以在eclipse中更改getter / setter的代码生成,以生成如 getLAttr()
和 setLAttr()
?
Can I change the code generation for getter/setter in eclipse to produce an output like getLAttr()
and setLAttr()
?
推荐答案
1)我不认为这是可能的,类似的讨论:
1) I don't think it's possible, similar discussion:
2)另一种选择是使用getter和setter的模板。虽然也有一个小问题,也是类似的讨论:
2) another option, as alternative, is to use templates for getters and setters. though there is a small problem there too, similar discussion:
这篇关于日食中奇怪的自动生成的吸气剂和食物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!