在Eclipse中自动创建getter [英] Create automatically only getters in Eclipse

查看:175
本文介绍了在Eclipse中自动创建getter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中,可以为一个字段自动创建Getters和Setter。但是我有很多私人领域,只有吸烟者应该存在。在Eclipse的某个地方,一个创建Getters函数也不会创建setter?

In Eclipse is it possible to create automatically Getters and Setters for a field. But I have a lot of private fields for which only getters should exist. Is somewhere in Eclipse a "create Getters" Function which does not create setters too?

嗯,写getter不是太多的工作,但是会自动执行很好:)

Well, it is not so much work to write getters, but doing it automatically would be nice :)

谢谢,
lerad

Thank you, lerad

推荐答案

生成Setters和Getters 屏幕上,您有选择getters 按钮在右侧 - 使用它。

On the Generate Setters and Getters screen you have Select getters button on the right - use it.

这篇关于在Eclipse中自动创建getter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆