JAXB runtime specify what to marshall
Im wondering is there any RUNTIME possibility how to select which fields should be omitted during marshalling. I know that there is @XmlTransient annotation, but that is not runtime.
E.g.
@XmlRootElement
public class Person {
@XmlElement
private String name;
@XmlElement
private int age;
}
w开发者_运维知识库anting both of those ouputs, but the decision is made runtime:
<person>
<name>foo</name>
<age>boo</age>
</person>
<person>
<name>foo</name>
</person>
精彩评论