JAXB: @XmlTransient on third-party or external super class

Posted by Phil on Stack Overflow See other posts from Stack Overflow or by Phil
Published on 2010-03-30T08:40:22Z Indexed on 2010/03/30 8:43 UTC
Read the original article Hit count: 523

Filed under:
|
|
|

Hi,

I need some help regarding the following issue with JAXB 2.1.

Sample: I've created a SpecialPerson class that extends a abstract class Person. Now I want to transform my object structure into a XML schema using JAXB. Thereby I don't want the Person XML type to appear in my XML schema to keep the schema simple. Instead I want the fields of the Person class to appear in the SpecialPerson XML type.

Normally I would add the annotation @XmlTransient on class level into the Person code.

The problem is that Person is a third-party class and I have no possibility to add @XmlTransient here. How can I tell JAXB that it should ignore the Person class without annotating the class. Is it possible to configure this externally somehow?

Have you had the same problem before? Any ideas what the best solution for this problem would be?

© Stack Overflow or respective owner

Related posts about jaxb

Related posts about Xml