hen I unmarshall a certain object I don't get back the type of the object but the type ElementNSImpl that appears to have my data in it but why won't JAXB unmarshall it into my JAXB classes?
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Asset", propOrder = { "platformContentOrFeatureContentOrAirspace", ... }) @XmlSeeAlso({ ... }) public abstract class Asset { @XmlElements({ @XmlElement(name = "PlatformContent", type = AnyPlatform.class), @XmlElement(name = "FeatureContent", type = AnyFeature.class), @XmlElement(name = "Airspace", type = Airspace.class) }) protected Object platformContentOrFeatureContentOrAirspace; ... public Object getPlatformContentorFeatureContentorAirspace(){ return platformContentOrFeatureContentOrAirspace; } ... } Here is a schema fragment:
<complexType name="AssetBaseType"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <choice minOccurs="0"> <element name="PlatformContent" type="temp:TargetNamespaceURI}AnyPlatform"/> <element name="FeatureContent" type="{temp:TargetNamespaceURI}AnyFeature"/> <element ref="{temp:TargetNamespaceURI}Airspace"/> </choice> </sequence> </restriction> </complexContent> </complexType>
No comments:
Post a Comment