For example, a bean:
class Foo {
private String name;
private String title;
private Integer grade;
// getters/setters
}
Is there a way to generate constants as followings at the beginning of the class Foo?
class Foo {
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_TITLE = "title";
public static final String PROPERTY_GRADE = "grade";
private String name;
private String title;
private Integer grade;
}
We have many bean classes all of which need the static constants defined, and they will be referenced in multiple places.