I know for @XmlTransient annotation, but sometimes I need this element and in other use cases I really have to prevent it from unmarshaling, because it contains base6开发者_运维技巧4 text. So I need to exclude it because performance problems.
Is there any way to dynamicly exclude one element from unmarshaling with JAXB?
Maybe it would be enough for you to have non-trivial setter? JAXB would call the setter and inside you would do something like this:
public void setMyProperty(String myProperty) {
if (someSpecialBusinessDecision()) {
this.myProperty = myProperty;
}
}
精彩评论