开发者

Hyperjaxb apply transient dynamically

Currently, I can instruct Hyberjaxb to not persist a node开发者_高级运维 in a xml object at compile time using the transient functionality. Is there anyway of applying this dynamically at runtime? If x=y, then persist particular node in xml object, otherwise do not persist.

Is there perhaps another strategy to deal with this?


I don't think this is a task for Hyperjaxb, since HJ is primarily a compile-time tool. There's a very limited runtime impact only.

Would it be enought to make a deep-copy of the object structure and then remove what you dont' want to be marshalled? You can use something like copyable plugin to generate nice copy/clone methods or even use a custom copy strategy.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜