I have this code which str
must be upper case and trimmed.
class A {
private String str;
public String getStr() { return str};
public void setStr(String str) {
if(str == null || str.equals(""))
this.str = str;
else
this.str = str.toUpperCase().trim();
}
}
What I'm looking for is to make it annotation based. Which could be used either as
@UpperCaseTrim private String str;
or @UpperCaseTrim public void setStr(String str) {...};
.
How could this be implemented, maybe in a best way? What would the annotation processor be?