001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: /* this file is generated by RelaxNGCC */
027: package com.sun.xml.internal.xsom.impl.parser.state;
028:
029: import org.xml.sax.SAXException;
030: import org.xml.sax.XMLReader;
031: import org.xml.sax.Attributes;
032: import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
033:
034: import com.sun.xml.internal.xsom.*;
035: import com.sun.xml.internal.xsom.parser.*;
036: import com.sun.xml.internal.xsom.impl.*;
037: import com.sun.xml.internal.xsom.impl.parser.*;
038: import org.xml.sax.Locator;
039: import org.xml.sax.ContentHandler;
040: import org.xml.sax.helpers.*;
041: import java.util.*;
042:
043: class group extends NGCCHandler {
044: private AnnotationImpl annotation;
045: private String name;
046: private ModelGroupImpl term;
047: private ForeignAttributesImpl fa;
048: protected final NGCCRuntimeEx $runtime;
049: private int $_ngcc_current_state;
050: protected String $uri;
051: protected String $localName;
052: protected String $qname;
053:
054: public final NGCCRuntime getRuntime() {
055: return ($runtime);
056: }
057:
058: public group(NGCCHandler parent, NGCCEventSource source,
059: NGCCRuntimeEx runtime, int cookie) {
060: super (source, parent, cookie);
061: $runtime = runtime;
062: $_ngcc_current_state = 15;
063: }
064:
065: public group(NGCCRuntimeEx runtime) {
066: this (null, runtime, runtime, -1);
067: }
068:
069: private void action0() throws SAXException {
070:
071: result = new ModelGroupDeclImpl($runtime.document, annotation,
072: loc, fa, $runtime.currentSchema.getTargetNamespace(),
073: name, term);
074:
075: }
076:
077: private void action1() throws SAXException {
078:
079: mloc = $runtime.copyLocator();
080: compositorName = $localName;
081:
082: }
083:
084: private void action2() throws SAXException {
085: loc = $runtime.copyLocator();
086: }
087:
088: public void enterElement(String $__uri, String $__local,
089: String $__qname, Attributes $attrs) throws SAXException {
090: int $ai;
091: $uri = $__uri;
092: $localName = $__local;
093: $qname = $__qname;
094: switch ($_ngcc_current_state) {
095: case 5: {
096: if (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
097: .equals("all")) || ($__uri
098: .equals("http://www.w3.org/2001/XMLSchema") && $__local
099: .equals("choice"))) || ($__uri
100: .equals("http://www.w3.org/2001/XMLSchema") && $__local
101: .equals("sequence")))) {
102: NGCCHandler h = new foreignAttributes(this ,
103: super ._source, $runtime, 467, null);
104: spawnChildFromEnterElement(h, $__uri, $__local,
105: $__qname, $attrs);
106: } else {
107: unexpectedEnterElement($__qname);
108: }
109: }
110: break;
111: case 0: {
112: revertToParentFromEnterElement(result, super ._cookie,
113: $__uri, $__local, $__qname, $attrs);
114: }
115: break;
116: case 3: {
117: if ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
118: .equals("all")) || ($__uri
119: .equals("http://www.w3.org/2001/XMLSchema") && $__local
120: .equals("choice"))) || ($__uri
121: .equals("http://www.w3.org/2001/XMLSchema") && $__local
122: .equals("sequence"))) || (($__uri
123: .equals("http://www.w3.org/2001/XMLSchema") && $__local
124: .equals("annotation")) || (($__uri
125: .equals("http://www.w3.org/2001/XMLSchema") && $__local
126: .equals("group")) || (($__uri
127: .equals("http://www.w3.org/2001/XMLSchema") && $__local
128: .equals("any")) || ($__uri
129: .equals("http://www.w3.org/2001/XMLSchema") && $__local
130: .equals("element"))))))) {
131: NGCCHandler h = new modelGroupBody(this , super ._source,
132: $runtime, 465, mloc, compositorName);
133: spawnChildFromEnterElement(h, $__uri, $__local,
134: $__qname, $attrs);
135: } else {
136: unexpectedEnterElement($__qname);
137: }
138: }
139: break;
140: case 6: {
141: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
142: .equals("annotation"))) {
143: NGCCHandler h = new annotation(this , super ._source,
144: $runtime, 469, null,
145: AnnotationContext.MODELGROUP_DECL);
146: spawnChildFromEnterElement(h, $__uri, $__local,
147: $__qname, $attrs);
148: } else {
149: $_ngcc_current_state = 5;
150: $runtime.sendEnterElement(super ._cookie, $__uri,
151: $__local, $__qname, $attrs);
152: }
153: }
154: break;
155: case 10: {
156: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
157: $runtime.consumeAttribute($ai);
158: $runtime.sendEnterElement(super ._cookie, $__uri,
159: $__local, $__qname, $attrs);
160: } else {
161: unexpectedEnterElement($__qname);
162: }
163: }
164: break;
165: case 4: {
166: if (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
167: .equals("all")) || ($__uri
168: .equals("http://www.w3.org/2001/XMLSchema") && $__local
169: .equals("choice"))) || ($__uri
170: .equals("http://www.w3.org/2001/XMLSchema") && $__local
171: .equals("sequence")))) {
172: $runtime.onEnterElementConsumed($__uri, $__local,
173: $__qname, $attrs);
174: $_ngcc_current_state = 3;
175: } else {
176: unexpectedEnterElement($__qname);
177: }
178: }
179: break;
180: case 15: {
181: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
182: .equals("group"))) {
183: $runtime.onEnterElementConsumed($__uri, $__local,
184: $__qname, $attrs);
185: action2();
186: $_ngcc_current_state = 11;
187: } else {
188: unexpectedEnterElement($__qname);
189: }
190: }
191: break;
192: case 11: {
193: if (($ai = $runtime.getAttributeIndex("", "ID")) >= 0) {
194: $runtime.consumeAttribute($ai);
195: $runtime.sendEnterElement(super ._cookie, $__uri,
196: $__local, $__qname, $attrs);
197: } else {
198: $_ngcc_current_state = 10;
199: $runtime.sendEnterElement(super ._cookie, $__uri,
200: $__local, $__qname, $attrs);
201: }
202: }
203: break;
204: default: {
205: unexpectedEnterElement($__qname);
206: }
207: break;
208: }
209: }
210:
211: public void leaveElement(String $__uri, String $__local,
212: String $__qname) throws SAXException {
213: int $ai;
214: $uri = $__uri;
215: $localName = $__local;
216: $qname = $__qname;
217: switch ($_ngcc_current_state) {
218: case 1: {
219: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
220: .equals("group"))) {
221: $runtime.onLeaveElementConsumed($__uri, $__local,
222: $__qname);
223: $_ngcc_current_state = 0;
224: action0();
225: } else {
226: unexpectedLeaveElement($__qname);
227: }
228: }
229: break;
230: case 0: {
231: revertToParentFromLeaveElement(result, super ._cookie,
232: $__uri, $__local, $__qname);
233: }
234: break;
235: case 3: {
236: if (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
237: .equals("all")) || ($__uri
238: .equals("http://www.w3.org/2001/XMLSchema") && $__local
239: .equals("choice"))) || ($__uri
240: .equals("http://www.w3.org/2001/XMLSchema") && $__local
241: .equals("sequence")))) {
242: NGCCHandler h = new modelGroupBody(this , super ._source,
243: $runtime, 465, mloc, compositorName);
244: spawnChildFromLeaveElement(h, $__uri, $__local,
245: $__qname);
246: } else {
247: unexpectedLeaveElement($__qname);
248: }
249: }
250: break;
251: case 6: {
252: $_ngcc_current_state = 5;
253: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
254: $__qname);
255: }
256: break;
257: case 10: {
258: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
259: $runtime.consumeAttribute($ai);
260: $runtime.sendLeaveElement(super ._cookie, $__uri,
261: $__local, $__qname);
262: } else {
263: unexpectedLeaveElement($__qname);
264: }
265: }
266: break;
267: case 2: {
268: if (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
269: .equals("all")) || ($__uri
270: .equals("http://www.w3.org/2001/XMLSchema") && $__local
271: .equals("choice"))) || ($__uri
272: .equals("http://www.w3.org/2001/XMLSchema") && $__local
273: .equals("sequence")))) {
274: $runtime.onLeaveElementConsumed($__uri, $__local,
275: $__qname);
276: $_ngcc_current_state = 1;
277: } else {
278: unexpectedLeaveElement($__qname);
279: }
280: }
281: break;
282: case 11: {
283: if (($ai = $runtime.getAttributeIndex("", "ID")) >= 0) {
284: $runtime.consumeAttribute($ai);
285: $runtime.sendLeaveElement(super ._cookie, $__uri,
286: $__local, $__qname);
287: } else {
288: $_ngcc_current_state = 10;
289: $runtime.sendLeaveElement(super ._cookie, $__uri,
290: $__local, $__qname);
291: }
292: }
293: break;
294: default: {
295: unexpectedLeaveElement($__qname);
296: }
297: break;
298: }
299: }
300:
301: public void enterAttribute(String $__uri, String $__local,
302: String $__qname) throws SAXException {
303: int $ai;
304: $uri = $__uri;
305: $localName = $__local;
306: $qname = $__qname;
307: switch ($_ngcc_current_state) {
308: case 0: {
309: revertToParentFromEnterAttribute(result, super ._cookie,
310: $__uri, $__local, $__qname);
311: }
312: break;
313: case 6: {
314: $_ngcc_current_state = 5;
315: $runtime.sendEnterAttribute(super ._cookie, $__uri,
316: $__local, $__qname);
317: }
318: break;
319: case 10: {
320: if (($__uri.equals("") && $__local.equals("name"))) {
321: $_ngcc_current_state = 9;
322: } else {
323: unexpectedEnterAttribute($__qname);
324: }
325: }
326: break;
327: case 11: {
328: if (($__uri.equals("") && $__local.equals("ID"))) {
329: $_ngcc_current_state = 13;
330: } else {
331: $_ngcc_current_state = 10;
332: $runtime.sendEnterAttribute(super ._cookie, $__uri,
333: $__local, $__qname);
334: }
335: }
336: break;
337: default: {
338: unexpectedEnterAttribute($__qname);
339: }
340: break;
341: }
342: }
343:
344: public void leaveAttribute(String $__uri, String $__local,
345: String $__qname) throws SAXException {
346: int $ai;
347: $uri = $__uri;
348: $localName = $__local;
349: $qname = $__qname;
350: switch ($_ngcc_current_state) {
351: case 8: {
352: if (($__uri.equals("") && $__local.equals("name"))) {
353: $_ngcc_current_state = 6;
354: } else {
355: unexpectedLeaveAttribute($__qname);
356: }
357: }
358: break;
359: case 0: {
360: revertToParentFromLeaveAttribute(result, super ._cookie,
361: $__uri, $__local, $__qname);
362: }
363: break;
364: case 6: {
365: $_ngcc_current_state = 5;
366: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
367: $__local, $__qname);
368: }
369: break;
370: case 12: {
371: if (($__uri.equals("") && $__local.equals("ID"))) {
372: $_ngcc_current_state = 10;
373: } else {
374: unexpectedLeaveAttribute($__qname);
375: }
376: }
377: break;
378: case 11: {
379: $_ngcc_current_state = 10;
380: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
381: $__local, $__qname);
382: }
383: break;
384: default: {
385: unexpectedLeaveAttribute($__qname);
386: }
387: break;
388: }
389: }
390:
391: public void text(String $value) throws SAXException {
392: int $ai;
393: switch ($_ngcc_current_state) {
394: case 0: {
395: revertToParentFromText(result, super ._cookie, $value);
396: }
397: break;
398: case 6: {
399: $_ngcc_current_state = 5;
400: $runtime.sendText(super ._cookie, $value);
401: }
402: break;
403: case 13: {
404: $_ngcc_current_state = 12;
405: }
406: break;
407: case 10: {
408: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
409: $runtime.consumeAttribute($ai);
410: $runtime.sendText(super ._cookie, $value);
411: }
412: }
413: break;
414: case 11: {
415: if (($ai = $runtime.getAttributeIndex("", "ID")) >= 0) {
416: $runtime.consumeAttribute($ai);
417: $runtime.sendText(super ._cookie, $value);
418: } else {
419: $_ngcc_current_state = 10;
420: $runtime.sendText(super ._cookie, $value);
421: }
422: }
423: break;
424: case 9: {
425: name = $value;
426: $_ngcc_current_state = 8;
427: }
428: break;
429: }
430: }
431:
432: public void onChildCompleted(Object $__result__, int $__cookie__,
433: boolean $__needAttCheck__) throws SAXException {
434: switch ($__cookie__) {
435: case 465: {
436: term = ((ModelGroupImpl) $__result__);
437: $_ngcc_current_state = 2;
438: }
439: break;
440: case 467: {
441: fa = ((ForeignAttributesImpl) $__result__);
442: action1();
443: $_ngcc_current_state = 4;
444: }
445: break;
446: case 469: {
447: annotation = ((AnnotationImpl) $__result__);
448: $_ngcc_current_state = 5;
449: }
450: break;
451: }
452: }
453:
454: public boolean accepted() {
455: return (($_ngcc_current_state == 0));
456: }
457:
458: private ModelGroupDeclImpl result;
459: private Locator loc, mloc;
460: private String compositorName;
461:
462: }
|