开发者

JAXB unmarshal exclude specific element

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;
    }
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜