Is there any way I can get the getter
method of a field, which is having different name from the usual standards?
class Employee {
private String name;
private String dept;
public String getTheName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTheDept() {
return dept;
}
public void setDept(String dept) {
this.dept = dept;
}
}
I know using reflection we can get the getter
method of a field if the getter
method is following the usual standard. Example:
- name ==> getName
- dept ==> getDept
But in our project, we are having a different convention than usual.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire