I've an XSD file containing this:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
elementFormDefault="qualified"
targetNamespace="http://example.org/">
<xsd:complexType name="Certificate">
<xsd:sequence>
<xsd:element name="certificate" type="xsd:base64Binary">
<xsd:annotation>
<xsd:appinfo>
<xjc:javaType name="java.security.cert.X509Certificate" adapter="adapters.X509CertificateAdapter" />
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:complexType name="User">
<xsd:sequence>
<xsd:element name="certificate" type="xsd:base64Binary">
<xsd:annotation>
<xsd:appinfo>
<xjc:javaType name="java.security.cert.X509Certificate" adapter="adapters.X509CertificateAdapter" />
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Server">
<xsd:sequence>
<xsd:element name="document" type="xsd:base64Binary" />
</xsd:sequence>
</xsd:complexType>
I would like to export xjc javaType adapter to an external .xjb file. In this file, I would like to set this adapter for all certificate
elements with xsd:base64Binary
type but not for document
element in Server
complex type which also has xsd:base64Binary
type.
How can I do it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…