I use Project Lombok to automatically generate getter and setter methods for all fields of a Java class.
When a field is annotated with e.g. @XmlTransient
, the annotation is not propagated to the generated getter/setter methods, thus in the resulting code it does not show any effect. Is there a way to use automatic getter/setter generation in conjunction with further annotations?
I don't think propagating annotations to getter/setter methods would work in the general case. For example do you know what would happen if both the field and the bean properties were annotated with @XmlElement
? For JAXB annotations I would suggest using @XmlAccessorType(XmlAccessType.FIELD)
on the field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With