users@jaxb.java.net

Setup a custom XmlAdapter rather than generating one

From: <christian-schulte_at_alice.de>
Date: Tue, 8 Mar 2011 00:25:13 +0000 (GMT)

Hi,

I am using the following customization:

<jaxb:property>
    <jaxb:baseType>
        <jaxb:javaType name="javax.activation.MimeType"/>
    </jaxb:baseType>
</jaxb:property>

XJC generates an 'Adapter1.java' class which does not compile, since
the MimeType(String) constructor may throw a checked
MimeTypeParseException.

I would like to write that Adapter1.java class manually, for example
MimeTypeXmlAdapter. Is it possible to customize XJC in a way to use
that custom adapter instead of generating one ? For example:

<jaxb:property>
    <jaxb:baseType>
        <jaxb:javaType name="javax.activation.MimeType"
                                 adapter="package.MimeTypeXmlAdapter"/>
    </jaxb:baseType>
</jaxb:property>

Thanks.