Skip to content

Commit 99d3c97

Browse files
committed
xjc:javaType example
1 parent 0966db1 commit 99d3c97

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/one/src/main/resources/schema.xsd

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?xml version="1.0"?>
22
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
33
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
4+
xmlns:annox="http://annox.dev.java.net"
5+
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
6+
jaxb:extensionBindingPrefixes="annox xjc"
47
jaxb:version="1.0">
58

69
<xs:annotation>
710
<xs:appinfo>
811
<jaxb:globalBindings choiceContentProperty="true" generateIsSetMethod="true" generateElementClass="true">
9-
<!--xjc:noValidator />
10-
<xjc:noValidatingUnmarshaller /-->
12+
<xjc:javaType name="java.lang.Boolean" xmlType="xs:boolean" adapter="org.jvnet.jaxb2_commons.tests.one.CustomBooleanAdapter"/>
1113
</jaxb:globalBindings>
1214
<jaxb:schemaBindings>
1315
<jaxb:package name="org.jvnet.jaxb2_commons.tests.one"/>
@@ -21,4 +23,19 @@
2123
<xs:element name="annotatedAdaptedProperty" type="xs:string" minOccurs="0"/>
2224
</xs:sequence>
2325
</xs:complexType>
26+
27+
<xs:complexType name="javaTypeExample">
28+
<xs:sequence>
29+
<xs:element name="customBooleanProperty" type="xs:boolean" minOccurs="0">
30+
<xs:annotation>
31+
<xs:appinfo>
32+
<annox:annotate target="field">@javax.xml.bind.annotation.XmlElement(type=java.lang.Boolean.class)</annox:annotate>
33+
<annox:annotate target="field">@javax.xml.bind.annotation.XmlSchemaType(name="boolean")</annox:annotate>
34+
</xs:appinfo>
35+
</xs:annotation>
36+
</xs:element>
37+
</xs:sequence>
38+
</xs:complexType>
39+
40+
2441
</xs:schema>

0 commit comments

Comments
 (0)