Not show XML element if setter in JAXB Model was not executed

RPPro

New Member
The following JAXB Model is given:\[code\]@XmlRootElement(name = "Customer")@XmlAccessorType(XmlAccessType.FIELD)public Customer { @XmlElement(name = "Name") private String name; @XmlElement(name = "IsVerified") private boolean isVerified; // Setter and getter for both attributes}\[/code\]I use this model for showing a REST resource in XML (GET request returns application/xml).When \[code\]name\[/code\] and \[code\]isVerified\[/code\] were not set with the appropriate setters the XML element \[code\]Name\[/code\] will not be showed in the resource, but \[code\]IsVerified\[/code\] appears and has the value \[code\]false\[/code\]. Is it possible to also not show the element \[code\]IsVerified\[/code\] in case its setter was not executed?
 
Back
Top