Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top