Reputation: 13407
I annotated a XmlAdapter class like so:
@XmlTransient
public class DateTimeXmlAdapter extends XmlAdapter<String, DateTime> {
but schemagen.exe generates
<xs:complexType name="xmlAdapter" abstract="true">
<xs:sequence/>
</xs:complexType>
so does't skip the class, which was what I expected. XmlAdapter indeed is an abstract class that my transient class inherits from. What should i do?
The reason I refer in a field to DateTimeXmlAdapter is:
@XmlElement(name="StartDatetime")
@XmlJavaTypeAdapter(DateTimeXmlAdapter.class)
protected DateTime startDatetime;
which is correct I think.
Upvotes: 3
Views: 947
Reputation: 403581
It looks like you've told schemagen
to generate schema types for everything in your java package, including the XmlAdapter
subclass. It therefore sees your adaptor class, which is marked as @XmlTransient
, and therefore doesn't generate a schema type for it. However, it does generate a schema type for XmlAdapter
itself.
You need to change how you invoke schemagen
so that your adapter class is excluded from the code generation. The @XmlTransient
isn't appropriate here, so remove that from the adapter class.
Upvotes: 1