|
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 |
|
44 |
|
45 class SimpleType_Restriction extends NGCCHandler { |
|
46 private Locator locator; |
|
47 private AnnotationImpl annotation; |
|
48 private String name; |
|
49 private UName baseTypeName; |
|
50 private Set finalSet; |
|
51 private ForeignAttributesImpl fa; |
|
52 private XSFacet facet; |
|
53 protected final NGCCRuntimeEx $runtime; |
|
54 private int $_ngcc_current_state; |
|
55 protected String $uri; |
|
56 protected String $localName; |
|
57 protected String $qname; |
|
58 |
|
59 public final NGCCRuntime getRuntime() { |
|
60 return($runtime); |
|
61 } |
|
62 |
|
63 public SimpleType_Restriction(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { |
|
64 super(source, parent, cookie); |
|
65 $runtime = runtime; |
|
66 this.annotation = _annotation; |
|
67 this.locator = _locator; |
|
68 this.fa = _fa; |
|
69 this.name = _name; |
|
70 this.finalSet = _finalSet; |
|
71 $_ngcc_current_state = 13; |
|
72 } |
|
73 |
|
74 public SimpleType_Restriction(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { |
|
75 this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet); |
|
76 } |
|
77 |
|
78 private void action0()throws SAXException { |
|
79 |
|
80 result.addFacet(facet); |
|
81 |
|
82 } |
|
83 |
|
84 private void action1()throws SAXException { |
|
85 |
|
86 result = new RestrictionSimpleTypeImpl( |
|
87 $runtime.document, annotation, locator, fa, name, name==null, finalSet, baseType ); |
|
88 |
|
89 } |
|
90 |
|
91 private void action2()throws SAXException { |
|
92 |
|
93 baseType = new DelayedRef.SimpleType( |
|
94 $runtime, rloc, $runtime.currentSchema, baseTypeName ); |
|
95 |
|
96 } |
|
97 |
|
98 private void action3()throws SAXException { |
|
99 rloc=$runtime.copyLocator(); |
|
100 } |
|
101 |
|
102 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { |
|
103 int $ai; |
|
104 $uri = $__uri; |
|
105 $localName = $__local; |
|
106 $qname = $__qname; |
|
107 switch($_ngcc_current_state) { |
|
108 case 12: |
|
109 { |
|
110 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","base"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) { |
|
111 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa); |
|
112 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
113 } |
|
114 else { |
|
115 unexpectedEnterElement($__qname); |
|
116 } |
|
117 } |
|
118 break; |
|
119 case 10: |
|
120 { |
|
121 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { |
|
122 NGCCHandler h = new annotation(this, super._source, $runtime, 164, annotation,AnnotationContext.SIMPLETYPE_DECL); |
|
123 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
124 } |
|
125 else { |
|
126 $_ngcc_current_state = 5; |
|
127 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
128 } |
|
129 } |
|
130 break; |
|
131 case 4: |
|
132 { |
|
133 action1(); |
|
134 $_ngcc_current_state = 2; |
|
135 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
136 } |
|
137 break; |
|
138 case 0: |
|
139 { |
|
140 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs); |
|
141 } |
|
142 break; |
|
143 case 5: |
|
144 { |
|
145 if(($ai = $runtime.getAttributeIndex("","base"))>=0) { |
|
146 $runtime.consumeAttribute($ai); |
|
147 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
148 } |
|
149 else { |
|
150 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { |
|
151 NGCCHandler h = new simpleType(this, super._source, $runtime, 158); |
|
152 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
153 } |
|
154 else { |
|
155 unexpectedEnterElement($__qname); |
|
156 } |
|
157 } |
|
158 } |
|
159 break; |
|
160 case 1: |
|
161 { |
|
162 if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) { |
|
163 NGCCHandler h = new facet(this, super._source, $runtime, 153); |
|
164 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
165 } |
|
166 else { |
|
167 unexpectedEnterElement($__qname); |
|
168 } |
|
169 } |
|
170 break; |
|
171 case 2: |
|
172 { |
|
173 if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) { |
|
174 NGCCHandler h = new facet(this, super._source, $runtime, 154); |
|
175 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); |
|
176 } |
|
177 else { |
|
178 $_ngcc_current_state = 1; |
|
179 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); |
|
180 } |
|
181 } |
|
182 break; |
|
183 case 13: |
|
184 { |
|
185 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) { |
|
186 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); |
|
187 action3(); |
|
188 $_ngcc_current_state = 12; |
|
189 } |
|
190 else { |
|
191 unexpectedEnterElement($__qname); |
|
192 } |
|
193 } |
|
194 break; |
|
195 default: |
|
196 { |
|
197 unexpectedEnterElement($__qname); |
|
198 } |
|
199 break; |
|
200 } |
|
201 } |
|
202 |
|
203 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { |
|
204 int $ai; |
|
205 $uri = $__uri; |
|
206 $localName = $__local; |
|
207 $qname = $__qname; |
|
208 switch($_ngcc_current_state) { |
|
209 case 12: |
|
210 { |
|
211 if((($ai = $runtime.getAttributeIndex("","base"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")))) { |
|
212 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa); |
|
213 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname); |
|
214 } |
|
215 else { |
|
216 unexpectedLeaveElement($__qname); |
|
217 } |
|
218 } |
|
219 break; |
|
220 case 10: |
|
221 { |
|
222 $_ngcc_current_state = 5; |
|
223 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
224 } |
|
225 break; |
|
226 case 4: |
|
227 { |
|
228 action1(); |
|
229 $_ngcc_current_state = 2; |
|
230 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
231 } |
|
232 break; |
|
233 case 0: |
|
234 { |
|
235 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname); |
|
236 } |
|
237 break; |
|
238 case 5: |
|
239 { |
|
240 if(($ai = $runtime.getAttributeIndex("","base"))>=0) { |
|
241 $runtime.consumeAttribute($ai); |
|
242 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
243 } |
|
244 else { |
|
245 unexpectedLeaveElement($__qname); |
|
246 } |
|
247 } |
|
248 break; |
|
249 case 1: |
|
250 { |
|
251 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) { |
|
252 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); |
|
253 $_ngcc_current_state = 0; |
|
254 } |
|
255 else { |
|
256 unexpectedLeaveElement($__qname); |
|
257 } |
|
258 } |
|
259 break; |
|
260 case 2: |
|
261 { |
|
262 $_ngcc_current_state = 1; |
|
263 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); |
|
264 } |
|
265 break; |
|
266 default: |
|
267 { |
|
268 unexpectedLeaveElement($__qname); |
|
269 } |
|
270 break; |
|
271 } |
|
272 } |
|
273 |
|
274 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { |
|
275 int $ai; |
|
276 $uri = $__uri; |
|
277 $localName = $__local; |
|
278 $qname = $__qname; |
|
279 switch($_ngcc_current_state) { |
|
280 case 12: |
|
281 { |
|
282 if(($__uri.equals("") && $__local.equals("base"))) { |
|
283 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa); |
|
284 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname); |
|
285 } |
|
286 else { |
|
287 unexpectedEnterAttribute($__qname); |
|
288 } |
|
289 } |
|
290 break; |
|
291 case 10: |
|
292 { |
|
293 $_ngcc_current_state = 5; |
|
294 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); |
|
295 } |
|
296 break; |
|
297 case 4: |
|
298 { |
|
299 action1(); |
|
300 $_ngcc_current_state = 2; |
|
301 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); |
|
302 } |
|
303 break; |
|
304 case 0: |
|
305 { |
|
306 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname); |
|
307 } |
|
308 break; |
|
309 case 5: |
|
310 { |
|
311 if(($__uri.equals("") && $__local.equals("base"))) { |
|
312 $_ngcc_current_state = 8; |
|
313 } |
|
314 else { |
|
315 unexpectedEnterAttribute($__qname); |
|
316 } |
|
317 } |
|
318 break; |
|
319 case 2: |
|
320 { |
|
321 $_ngcc_current_state = 1; |
|
322 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); |
|
323 } |
|
324 break; |
|
325 default: |
|
326 { |
|
327 unexpectedEnterAttribute($__qname); |
|
328 } |
|
329 break; |
|
330 } |
|
331 } |
|
332 |
|
333 public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { |
|
334 int $ai; |
|
335 $uri = $__uri; |
|
336 $localName = $__local; |
|
337 $qname = $__qname; |
|
338 switch($_ngcc_current_state) { |
|
339 case 7: |
|
340 { |
|
341 if(($__uri.equals("") && $__local.equals("base"))) { |
|
342 $_ngcc_current_state = 4; |
|
343 } |
|
344 else { |
|
345 unexpectedLeaveAttribute($__qname); |
|
346 } |
|
347 } |
|
348 break; |
|
349 case 10: |
|
350 { |
|
351 $_ngcc_current_state = 5; |
|
352 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); |
|
353 } |
|
354 break; |
|
355 case 4: |
|
356 { |
|
357 action1(); |
|
358 $_ngcc_current_state = 2; |
|
359 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); |
|
360 } |
|
361 break; |
|
362 case 0: |
|
363 { |
|
364 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname); |
|
365 } |
|
366 break; |
|
367 case 2: |
|
368 { |
|
369 $_ngcc_current_state = 1; |
|
370 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); |
|
371 } |
|
372 break; |
|
373 default: |
|
374 { |
|
375 unexpectedLeaveAttribute($__qname); |
|
376 } |
|
377 break; |
|
378 } |
|
379 } |
|
380 |
|
381 public void text(String $value) throws SAXException { |
|
382 int $ai; |
|
383 switch($_ngcc_current_state) { |
|
384 case 8: |
|
385 { |
|
386 NGCCHandler h = new qname(this, super._source, $runtime, 160); |
|
387 spawnChildFromText(h, $value); |
|
388 } |
|
389 break; |
|
390 case 12: |
|
391 { |
|
392 if(($ai = $runtime.getAttributeIndex("","base"))>=0) { |
|
393 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa); |
|
394 spawnChildFromText(h, $value); |
|
395 } |
|
396 } |
|
397 break; |
|
398 case 10: |
|
399 { |
|
400 $_ngcc_current_state = 5; |
|
401 $runtime.sendText(super._cookie, $value); |
|
402 } |
|
403 break; |
|
404 case 4: |
|
405 { |
|
406 action1(); |
|
407 $_ngcc_current_state = 2; |
|
408 $runtime.sendText(super._cookie, $value); |
|
409 } |
|
410 break; |
|
411 case 0: |
|
412 { |
|
413 revertToParentFromText(result, super._cookie, $value); |
|
414 } |
|
415 break; |
|
416 case 5: |
|
417 { |
|
418 if(($ai = $runtime.getAttributeIndex("","base"))>=0) { |
|
419 $runtime.consumeAttribute($ai); |
|
420 $runtime.sendText(super._cookie, $value); |
|
421 } |
|
422 } |
|
423 break; |
|
424 case 2: |
|
425 { |
|
426 $_ngcc_current_state = 1; |
|
427 $runtime.sendText(super._cookie, $value); |
|
428 } |
|
429 break; |
|
430 } |
|
431 } |
|
432 |
|
433 public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException { |
|
434 switch($__cookie__) { |
|
435 case 160: |
|
436 { |
|
437 baseTypeName = ((UName)$__result__); |
|
438 action2(); |
|
439 $_ngcc_current_state = 7; |
|
440 } |
|
441 break; |
|
442 case 164: |
|
443 { |
|
444 annotation = ((AnnotationImpl)$__result__); |
|
445 $_ngcc_current_state = 5; |
|
446 } |
|
447 break; |
|
448 case 154: |
|
449 { |
|
450 facet = ((XSFacet)$__result__); |
|
451 action0(); |
|
452 $_ngcc_current_state = 1; |
|
453 } |
|
454 break; |
|
455 case 166: |
|
456 { |
|
457 fa = ((ForeignAttributesImpl)$__result__); |
|
458 $_ngcc_current_state = 10; |
|
459 } |
|
460 break; |
|
461 case 158: |
|
462 { |
|
463 baseType = ((SimpleTypeImpl)$__result__); |
|
464 $_ngcc_current_state = 4; |
|
465 } |
|
466 break; |
|
467 case 153: |
|
468 { |
|
469 facet = ((XSFacet)$__result__); |
|
470 action0(); |
|
471 $_ngcc_current_state = 1; |
|
472 } |
|
473 break; |
|
474 } |
|
475 } |
|
476 |
|
477 public boolean accepted() { |
|
478 return(($_ngcc_current_state == 0)); |
|
479 } |
|
480 |
|
481 |
|
482 /** computed simple type object */ |
|
483 private RestrictionSimpleTypeImpl result; |
|
484 |
|
485 // reference to the base type |
|
486 private Ref.SimpleType baseType; |
|
487 |
|
488 // location of restriction |
|
489 private Locator rloc; |
|
490 |
|
491 } |