comparison src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng @ 0:0961a4a21176

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children 31822b475baa
comparison
equal deleted inserted replaced
-1:000000000000 0:3889eca8246c
1 <?xml version="1.0"?>
2 <!--
3 DTD binding information file which is supported by this version of XJC.
4 $Id: bindingfile.rng,v 1.1 2005/04/15 20:09:43 kohsuke Exp $
5
6 - Changes from the EA1 is marked by "CHANGE:"
7 - "ref:key" and "ref:keyref" are used to specify cross-reference
8 information.
9 - "a:defaultValue" is used to specify the default behavior.
10 Note that default behaviors are hard-coded to the source code.
11 Values specified in this schema is not used in the actual processing.
12 -->
13 <grammar
14 xmlns="http://relaxng.org/ns/structure/1.0"
15 xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
16 xmlns:a="http://relaxng.org/ns/annotation/1.0"
17 xmlns:ref="urn:crossreference"
18 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
19
20 <start>
21 <element name="xml-java-binding-schema">
22 <optional>
23 <attribute name="version">
24 <value>1.0ea2</value>
25 </attribute>
26 </optional>
27
28 <interleave>
29 <optional>
30 <element name="options">
31 <optional>
32 <attribute name="package"/>
33 </optional>
34 </element>
35 </optional>
36 <optional>
37 <element name="xjc:serializable">
38 <optional>
39 <attribute name="uid">
40 <data type="long"/>
41 </attribute>
42 </optional>
43 </element>
44 </optional>
45 <optional>
46 <element name="xjc:superClass">
47 <attribute name="name"/>
48 </element>
49 </optional>
50 <!-- light-weight runtime -->
51 <optional>
52 <element name="xjc:noMarshaller">
53 <empty/>
54 </element>
55 </optional>
56 <optional>
57 <element name="xjc:noUnmarshaller">
58 <empty/>
59 </element>
60 </optional>
61 <optional>
62 <element name="xjc:noValidator">
63 <empty/>
64 </element>
65 </optional>
66 <optional>
67 <element name="xjc:noValidatingUnmarshaller">
68 <empty/>
69 </element>
70 </optional>
71 <zeroOrMore>
72 <choice>
73 <ref name="toplevel.declaration"/>
74 <ref name="global.or.local.declaration"/>
75 </choice>
76 </zeroOrMore>
77 </interleave>
78 </element>
79 </start>
80
81
82
83
84 <!-- element-class declaration -->
85 <define name="toplevel.declaration" combine="choice">
86 <element name="element">
87 <attribute name="name"/>
88 <attribute name="type">
89 <value>class</value>
90 </attribute>
91 <optional>
92 <attribute name="class">
93 <ref name="java.classname.datatype"/>
94 </attribute>
95 </optional>
96 <optional>
97 <attribute name="root" a:defaultValue="false">
98 <choice>
99 <value>true</value>
100 <value>false</value>
101 </choice>
102 </attribute>
103 </optional>
104
105 <interleave>
106 <!-- attribute-property declaration -->
107 <zeroOrMore>
108 <element name="attribute">
109 <attribute name="name"/>
110 <optional>
111 <attribute name="property"/>
112 </optional>
113 <optional>
114 <ref name="collection.att"/>
115 </optional>
116 <optional>
117 <attribute name="convert">
118 <text ref:keyref="conversion"/>
119 </attribute>
120 </optional>
121 </element>
122 </zeroOrMore>
123
124 <zeroOrMore>
125 <ref name="global.or.local.declaration"/>
126 </zeroOrMore>
127
128 <!-- element-local declarations -->
129 <zeroOrMore>
130 <element name="constructor">
131 <attribute name="properties">
132 <list>
133 <oneOrMore>
134 <!-- point to a property defined in this element -->
135 <data type="token"/>
136 </oneOrMore>
137 </list>
138 </attribute>
139 </element>
140 </zeroOrMore>
141
142 <optional>
143 <element name="content">
144 <interleave>
145 <choice>
146 <!-- general content-property declaration -->
147 <ref name="collection.particle.decl"/>
148
149 <!-- model-based content property declaration -->
150 <group>
151 <zeroOrMore>
152 <choice>
153 <element name="element-ref">
154 <attribute name="name"/>
155 <optional>
156 <attribute name="property"/>
157 </optional>
158 <optional>
159 <ref name="collection.att"/>
160 </optional>
161 </element>
162 <element>
163 <choice>
164 <name>sequence</name>
165 <name>choice</name>
166 </choice>
167 <ref name="collection.particle.decl"/>
168 </element>
169 </choice>
170 </zeroOrMore>
171 <optional><!-- followed by an optional <rest> -->
172 <element name="rest">
173 <ref name="collection.particle.decl"/>
174 </element>
175 </optional>
176 </group>
177 </choice>
178 </interleave>
179 </element>
180 </optional>
181 </interleave>
182 </element>
183 </define>
184
185 <define name="collection.particle.decl">
186 <attribute name="property"/>
187 <optional>
188 <ref name="collection.att"/>
189 </optional>
190 <optional>
191 <attribute name="supertype"/>
192 </optional>
193 </define>
194
195 <define name="collection.att">
196 <attribute name="collection">
197 <!-- CHANGE: array is removed and set,vector are added -->
198 <choice>
199 <value>list</value>
200 <value>set</value>
201 <value>vector</value>
202 </choice>
203 </attribute>
204 </define>
205
206
207
208 <!-- conversion declaration -->
209 <define name="global.or.local.declaration" combine="choice">
210 <element name="conversion">
211 <attribute name="name" ref:key="conversion"/>
212 <optional>
213 <!-- defaults to @name -->
214 <attribute name="type"/>
215 </optional>
216 <optional>
217 <attribute name="parse" a:defaultValue="new"/>
218 </optional>
219 <optional>
220 <attribute name="print" a:defaultValue="toString"/>
221 </optional>
222 <optional>
223 <attribute name="whitespace" a:defaultValue="collapse">
224 <choice>
225 <value>preserve</value>
226 <value>replace</value><!-- CHANGE: it was normalize -->
227 <value>collapse</value>
228 </choice>
229 </attribute>
230 </optional>
231 </element>
232 </define>
233
234 <!-- element-value declaration -->
235 <define name="toplevel.declaration" combine="choice">
236 <element name="element">
237 <attribute name="name"/>
238 <attribute name="type">
239 <value>value</value>
240 </attribute>
241 <optional>
242 <attribute name="convert">
243 <text ref:keyref="conversion"/>
244 </attribute>
245 </optional>
246 </element>
247 </define>
248
249 <!-- interface declaration -->
250 <define name="toplevel.declaration" combine="choice">
251 <element name="interface">
252 <attribute name="name">
253 <ref name="java.classname.datatype"/>
254 </attribute>
255 <attribute name="members">
256 <list>
257 <oneOrMore>
258 <ref name="java.classname.datatype"/>
259 </oneOrMore>
260 </list>
261 </attribute>
262 <!-- CHANGE: TODO: @properties is not supported yet -->
263 </element>
264 </define>
265
266 <!-- enumeration declaration -->
267 <define name="global.or.local.declaration" combine="choice">
268 <element name="enumeration">
269 <attribute name="name">
270 <ref name="java.classname.datatype"/>
271 </attribute>
272 <attribute name="members">
273 <list>
274 <oneOrMore>
275 <data type="token"/>
276 </oneOrMore>
277 </list>
278 </attribute>
279 </element>
280 </define>
281
282
283
284 <!-- valid Java name -->
285 <define name="java.name.datatype">
286 <!-- TODO: add pattern facet or implement a custom datatype -->
287 <data type="token"/>
288 </define>
289
290 <define name="java.classname.datatype">
291 <ref name="java.name.datatype"/>
292 </define>
293 </grammar>