开发者

pass subclass instances as superclass with Jaxb

I need to send/receive polymorphic objects from/to server while invoking my spring enabled restful service.

Please let me know if xmlseealso annotation can be use开发者_如何转开发ful even when there are more than 1 subclass in the class hierarchy. I'm askign this because, even though i pass 2 to 3 subclasses inside xmlseealso annotation, only the last subclass is considered when unmarshalling takes place.

like when the parent model is as below,

@XmlSeeAlso({RateFix.class, EarlyRedemption.class}) public class Instruction implements Serializable

jaxb2 always unmarshall the Instruction to EarlyRedemption model while it actually refers to RateFix.

I'm using jaxb 1.0 jars only where i can find the xmlseealso annotation Please share me your view. Thanks.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜