假设有这样一个domain
public class Car {
@MyAnno("奔驰")
private String brand;
@MyAnno("红色")
private String color;
@Override
public String toString() {
return "Car{" +
"brand='" + brand + '\'' +
", color='" + color + '\'' +
'}';
}
public Car() {
}
public Car(String brand, String color) {
this.brand = brand;
this.color = color;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
自定义注解来设置属性值&