根据类成员变量生成getter setter

public class GetterSetterTest {
	private String dBComponentName;
	private String pRocComponent;
	private String authComponentName;
	
	public String getAuthComponentName() {
		return authComponentName;
	}
	
	public void setAuthComponentName(String authComponentName) {
		this.authComponentName = authComponentName;
	}
	
	public String getpRocComponent() {
		return pRocComponent;
	}

	public void setpRocComponent(String pRocComponent) {
		this.pRocComponent = pRocComponent;
	}

	public String getdBComponentName() {
		return dBComponentName;
	}

	public void setdBComponentName(String dBComponentName) {
		this.dBComponentName = dBComponentName;
	}
	
}

  当类成员变量的第二个字母是大写时,如上面的dBComponentName,则生成的getter,setter方法的名字分别是getdBComponentName,setdBComponentName,而不是

getDBComponentName,setDBComponentName, 这个在动态生成java文件时需要注意!

posted @ 2012-08-09 20:48  feiling  阅读(301)  评论(0编辑  收藏  举报