|
1 /* |
|
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Oracle designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Oracle in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 * or visit www.oracle.com if you need additional information or have any |
|
23 * questions. |
|
24 */ |
|
25 |
|
26 /* this file is generated by RelaxNGCC */ |
|
27 package com.sun.xml.internal.xsom.impl.parser.state; |
|
28 import org.xml.sax.SAXException; |
|
29 import org.xml.sax.XMLReader; |
|
30 import org.xml.sax.Attributes; |
|
31 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; |
|
32 |
|
33 import com.sun.xml.internal.xsom.*; |
|
34 import com.sun.xml.internal.xsom.parser.*; |
|
35 import com.sun.xml.internal.xsom.impl.*; |
|
36 import com.sun.xml.internal.xsom.impl.parser.*; |
|
37 import org.xml.sax.Locator; |
|
38 import org.xml.sax.ContentHandler; |
|
39 import org.xml.sax.helpers.*; |
|
40 import java.util.*; |
|
41 import java.math.BigInteger; |
|
42 |
|
43 import java.util.Vector; |
|
44 |
|
45 |
|
46 class SimpleType_Union extends NGCCHandler { |
|
47 private Locator locator; |
|
48 private AnnotationImpl annotation; |
|
49 private String __text; |
|
50 private UName memberTypeName; |
|
51 private String name; |
|
52 private Set finalSet; |
|
53 private ForeignAttributesImpl fa; |
|
54 private SimpleTypeImpl anonymousMemberType; |
|
55 protected final NGCCRuntimeEx $runtime; |
|
56 private int $_ngcc_current_state; |
|
57 protected String $uri; |
|
58 protected String $localName; |
|
59 protected String $qname; |
|
60 |
|
61 public final NGCCRuntime getRuntime() { |
|
62 return($runtime); |
|
63 } |
|
64 |
|
65 public SimpleType_Union(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { |
|
66 super(source, parent, cookie); |
|
67 $runtime = runtime; |
|
68 this.annotation = _annotation; |
|
69 this.locator = _locator; |
|
70 this.fa = _fa; |
|
71 this.name = _name; |
|
72 this.finalSet = _finalSet; |
|
73 $_ngcc_current_state = 12; |
|
74 } |
|
75 |
|
76 public SimpleType_Union(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { |
|
77 this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet); |
|
78 } |
|
79 |
|
80 private void action0()throws SAXException { |
|
81 |
|
82 result = new UnionSimpleTypeImpl( |
|
83 $runtime.document, annotation, locator, fa, name, name==null, finalSet, |
|
84 (Ref.SimpleType[])members.toArray(new Ref.SimpleType[members.size()]) ); |
|
85 |
|
86 } |
|
87 |
|
88 private void action1()throws SAXException { |
|
89 |
|
90 members.add(anonymousMemberType); |
|
91 |
|
92 } |
|
93 |
|
94 private void action2()throws SAXException { |
|
95 |
|
96 members.add( new DelayedRef.SimpleType( |
|
97 $runtime, uloc, $runtime.currentSchema, memberTypeName)); |
|
98 |
|
99 } |
|
100 |
|
101 private void action3()throws SAXException { |
|
102 $runtime.processList(__text);} |
|
103 |
|
104 private void action4()throws SAXException { |
|
105 uloc=$runtime.copyLocator(); |
|
106 } |
|
107 |
|
108 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { |
|
109 int $ai; |
|
110 $uri = $__uri; |
|
111 $localName = $__local; |
|
112 $qname = $__qname; |
|
113 switch($_ngcc_current_state) { |
|
114 case 4: |
|
115 { |
|
116 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { |
|
117 NGCCHandler h = new annotation(this, super._source, $runtime, 183, annotation,AnnotationContext.SIMPLETYPE_DECL); |
|
118 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
119 } |
|
120 else { |
|
121 $_ngcc_current_state = 2; |
|
122 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
123 } |
|
124 } |
|
125 break; |
|
126 case 0: |
|
127 { |
|
128 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs); |
|
129 } |
|
130 break; |
|
131 case 1: |
|
132 { |
|
133 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { |
|
134 NGCCHandler h = new simpleType(this, super._source, $runtime, 179); |
|
135 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
136 } |
|
137 else { |
|
138 unexpectedEnterElement($__qname); |
|
139 } |
|
140 } |
|
141 break; |
|
142 case 7: |
|
143 { |
|
144 if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) { |
|
145 $runtime.consumeAttribute($ai); |
|
146 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
147 } |
|
148 else { |
|
149 $_ngcc_current_state = 6; |
|
150 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
151 } |
|
152 } |
|
153 break; |
|
154 case 12: |
|
155 { |
|
156 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) { |
|
157 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); |
|
158 action4(); |
|
159 $_ngcc_current_state = 7; |
|
160 } |
|
161 else { |
|
162 unexpectedEnterElement($__qname); |
|
163 } |
|
164 } |
|
165 break; |
|
166 case 2: |
|
167 { |
|
168 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { |
|
169 NGCCHandler h = new simpleType(this, super._source, $runtime, 180); |
|
170 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
171 } |
|
172 else { |
|
173 $_ngcc_current_state = 1; |
|
174 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
175 } |
|
176 } |
|
177 break; |
|
178 case 6: |
|
179 { |
|
180 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) { |
|
181 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 185, fa); |
|
182 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
183 } |
|
184 else { |
|
185 unexpectedEnterElement($__qname); |
|
186 } |
|
187 } |
|
188 break; |
|
189 default: |
|
190 { |
|
191 unexpectedEnterElement($__qname); |
|
192 } |
|
193 break; |
|
194 } |
|
195 } |
|
196 |
|
197 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { |
|
198 int $ai; |
|
199 $uri = $__uri; |
|
200 $localName = $__local; |
|
201 $qname = $__qname; |
|
202 switch($_ngcc_current_state) { |
|
203 case 4: |
|
204 { |
|
205 $_ngcc_current_state = 2; |
|
206 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
207 } |
|
208 break; |
|
209 case 0: |
|
210 { |
|
211 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname); |
|
212 } |
|
213 break; |
|
214 case 1: |
|
215 { |
|
216 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) { |
|
217 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); |
|
218 $_ngcc_current_state = 0; |
|
219 action0(); |
|
220 } |
|
221 else { |
|
222 unexpectedLeaveElement($__qname); |
|
223 } |
|
224 } |
|
225 break; |
|
226 case 7: |
|
227 { |
|
228 if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) { |
|
229 $runtime.consumeAttribute($ai); |
|
230 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
231 } |
|
232 else { |
|
233 $_ngcc_current_state = 6; |
|
234 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
235 } |
|
236 } |
|
237 break; |
|
238 case 2: |
|
239 { |
|
240 $_ngcc_current_state = 1; |
|
241 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
242 } |
|
243 break; |
|
244 case 6: |
|
245 { |
|
246 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) { |
|
247 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 185, fa); |
|
248 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname); |
|
249 } |
|
250 else { |
|
251 unexpectedLeaveElement($__qname); |
|
252 } |
|
253 } |
|
254 break; |
|
255 default: |
|
256 { |
|
257 unexpectedLeaveElement($__qname); |
|
258 } |
|
259 break; |
|
260 } |
|
261 } |
|
262 |
|
263 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { |
|
264 int $ai; |
|
265 $uri = $__uri; |
|
266 $localName = $__local; |
|
267 $qname = $__qname; |
|
268 switch($_ngcc_current_state) { |
|
269 case 4: |
|
270 { |
|
271 $_ngcc_current_state = 2; |
|
272 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); |
|
273 } |
|
274 break; |
|
275 case 0: |
|
276 { |
|
277 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname); |
|
278 } |
|
279 break; |
|
280 case 7: |
|
281 { |
|
282 if(($__uri.equals("") && $__local.equals("memberTypes"))) { |
|
283 $_ngcc_current_state = 10; |
|
284 } |
|
285 else { |
|
286 $_ngcc_current_state = 6; |
|
287 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); |
|
288 } |
|
289 } |
|
290 break; |
|
291 case 2: |
|
292 { |
|
293 $_ngcc_current_state = 1; |
|
294 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); |
|
295 } |
|
296 break; |
|
297 default: |
|
298 { |
|
299 unexpectedEnterAttribute($__qname); |
|
300 } |
|
301 break; |
|
302 } |
|
303 } |
|
304 |
|
305 public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { |
|
306 int $ai; |
|
307 $uri = $__uri; |
|
308 $localName = $__local; |
|
309 $qname = $__qname; |
|
310 switch($_ngcc_current_state) { |
|
311 case 4: |
|
312 { |
|
313 $_ngcc_current_state = 2; |
|
314 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); |
|
315 } |
|
316 break; |
|
317 case 0: |
|
318 { |
|
319 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname); |
|
320 } |
|
321 break; |
|
322 case 7: |
|
323 { |
|
324 $_ngcc_current_state = 6; |
|
325 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); |
|
326 } |
|
327 break; |
|
328 case 8: |
|
329 { |
|
330 if(($__uri.equals("") && $__local.equals("memberTypes"))) { |
|
331 $_ngcc_current_state = 6; |
|
332 } |
|
333 else { |
|
334 unexpectedLeaveAttribute($__qname); |
|
335 } |
|
336 } |
|
337 break; |
|
338 case 2: |
|
339 { |
|
340 $_ngcc_current_state = 1; |
|
341 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); |
|
342 } |
|
343 break; |
|
344 default: |
|
345 { |
|
346 unexpectedLeaveAttribute($__qname); |
|
347 } |
|
348 break; |
|
349 } |
|
350 } |
|
351 |
|
352 public void text(String $value) throws SAXException { |
|
353 int $ai; |
|
354 switch($_ngcc_current_state) { |
|
355 case 4: |
|
356 { |
|
357 $_ngcc_current_state = 2; |
|
358 $runtime.sendText(super._cookie, $value); |
|
359 } |
|
360 break; |
|
361 case 9: |
|
362 { |
|
363 NGCCHandler h = new qname(this, super._source, $runtime, 187); |
|
364 spawnChildFromText(h, $value); |
|
365 } |
|
366 break; |
|
367 case 10: |
|
368 { |
|
369 __text = $value; |
|
370 $_ngcc_current_state = 9; |
|
371 action3(); |
|
372 } |
|
373 break; |
|
374 case 0: |
|
375 { |
|
376 revertToParentFromText(result, super._cookie, $value); |
|
377 } |
|
378 break; |
|
379 case 7: |
|
380 { |
|
381 if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) { |
|
382 $runtime.consumeAttribute($ai); |
|
383 $runtime.sendText(super._cookie, $value); |
|
384 } |
|
385 else { |
|
386 $_ngcc_current_state = 6; |
|
387 $runtime.sendText(super._cookie, $value); |
|
388 } |
|
389 } |
|
390 break; |
|
391 case 8: |
|
392 { |
|
393 NGCCHandler h = new qname(this, super._source, $runtime, 188); |
|
394 spawnChildFromText(h, $value); |
|
395 } |
|
396 break; |
|
397 case 2: |
|
398 { |
|
399 $_ngcc_current_state = 1; |
|
400 $runtime.sendText(super._cookie, $value); |
|
401 } |
|
402 break; |
|
403 } |
|
404 } |
|
405 |
|
406 public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException { |
|
407 switch($__cookie__) { |
|
408 case 183: |
|
409 { |
|
410 annotation = ((AnnotationImpl)$__result__); |
|
411 $_ngcc_current_state = 2; |
|
412 } |
|
413 break; |
|
414 case 187: |
|
415 { |
|
416 memberTypeName = ((UName)$__result__); |
|
417 action2(); |
|
418 $_ngcc_current_state = 8; |
|
419 } |
|
420 break; |
|
421 case 179: |
|
422 { |
|
423 anonymousMemberType = ((SimpleTypeImpl)$__result__); |
|
424 action1(); |
|
425 $_ngcc_current_state = 1; |
|
426 } |
|
427 break; |
|
428 case 188: |
|
429 { |
|
430 memberTypeName = ((UName)$__result__); |
|
431 action2(); |
|
432 $_ngcc_current_state = 8; |
|
433 } |
|
434 break; |
|
435 case 185: |
|
436 { |
|
437 fa = ((ForeignAttributesImpl)$__result__); |
|
438 $_ngcc_current_state = 4; |
|
439 } |
|
440 break; |
|
441 case 180: |
|
442 { |
|
443 anonymousMemberType = ((SimpleTypeImpl)$__result__); |
|
444 action1(); |
|
445 $_ngcc_current_state = 1; |
|
446 } |
|
447 break; |
|
448 } |
|
449 } |
|
450 |
|
451 public boolean accepted() { |
|
452 return(($_ngcc_current_state == 0)); |
|
453 } |
|
454 |
|
455 |
|
456 /** computed simple type object */ |
|
457 private UnionSimpleTypeImpl result; |
|
458 |
|
459 // Vector of Ref.SimpleType |
|
460 private final Vector members = new Vector(); |
|
461 |
|
462 // locator of <union> |
|
463 private Locator uloc; |
|
464 |
|
465 } |