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 attributeGroupDecl extends NGCCHandler {
044: private AnnotationImpl annotation;
045: private String name;
046: private ForeignAttributesImpl fa;
047: protected final NGCCRuntimeEx $runtime;
048: private int $_ngcc_current_state;
049: protected String $uri;
050: protected String $localName;
051: protected String $qname;
052:
053: public final NGCCRuntime getRuntime() {
054: return ($runtime);
055: }
056:
057: public attributeGroupDecl(NGCCHandler parent,
058: NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
059: super (source, parent, cookie);
060: $runtime = runtime;
061: $_ngcc_current_state = 14;
062: }
063:
064: public attributeGroupDecl(NGCCRuntimeEx runtime) {
065: this (null, runtime, runtime, -1);
066: }
067:
068: private void action0() throws SAXException {
069:
070: result = new AttGroupDeclImpl($runtime.document, annotation,
071: locator, fa, name);
072:
073: }
074:
075: private void action1() throws SAXException {
076: locator = $runtime.copyLocator();
077: }
078:
079: public void enterElement(String $__uri, String $__local,
080: String $__qname, Attributes $attrs) throws SAXException {
081: int $ai;
082: $uri = $__uri;
083: $localName = $__local;
084: $qname = $__qname;
085: switch ($_ngcc_current_state) {
086: case 4: {
087: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
088: .equals("annotation"))) {
089: NGCCHandler h = new annotation(this , super ._source,
090: $runtime, 360, null,
091: AnnotationContext.ATTRIBUTE_GROUP);
092: spawnChildFromEnterElement(h, $__uri, $__local,
093: $__qname, $attrs);
094: } else {
095: $_ngcc_current_state = 3;
096: $runtime.sendEnterElement(super ._cookie, $__uri,
097: $__local, $__qname, $attrs);
098: }
099: }
100: break;
101: case 0: {
102: revertToParentFromEnterElement(result, super ._cookie,
103: $__uri, $__local, $__qname, $attrs);
104: }
105: break;
106: case 6: {
107: if ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
108: .equals("annotation")) || (($__uri
109: .equals("http://www.w3.org/2001/XMLSchema") && $__local
110: .equals("attribute")) || (($__uri
111: .equals("http://www.w3.org/2001/XMLSchema") && $__local
112: .equals("attributeGroup")) || ($__uri
113: .equals("http://www.w3.org/2001/XMLSchema") && $__local
114: .equals("anyAttribute")))))) {
115: NGCCHandler h = new foreignAttributes(this ,
116: super ._source, $runtime, 362, fa);
117: spawnChildFromEnterElement(h, $__uri, $__local,
118: $__qname, $attrs);
119: } else {
120: unexpectedEnterElement($__qname);
121: }
122: }
123: break;
124: case 7: {
125: if (($ai = $runtime.getAttributeIndex("", "id")) >= 0) {
126: $runtime.consumeAttribute($ai);
127: $runtime.sendEnterElement(super ._cookie, $__uri,
128: $__local, $__qname, $attrs);
129: } else {
130: $_ngcc_current_state = 6;
131: $runtime.sendEnterElement(super ._cookie, $__uri,
132: $__local, $__qname, $attrs);
133: }
134: }
135: break;
136: case 13: {
137: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
138: $runtime.consumeAttribute($ai);
139: $runtime.sendEnterElement(super ._cookie, $__uri,
140: $__local, $__qname, $attrs);
141: } else {
142: unexpectedEnterElement($__qname);
143: }
144: }
145: break;
146: case 14: {
147: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
148: .equals("attributeGroup"))) {
149: $runtime.onEnterElementConsumed($__uri, $__local,
150: $__qname, $attrs);
151: action1();
152: $_ngcc_current_state = 13;
153: } else {
154: unexpectedEnterElement($__qname);
155: }
156: }
157: break;
158: case 3: {
159: action0();
160: $_ngcc_current_state = 2;
161: $runtime.sendEnterElement(super ._cookie, $__uri, $__local,
162: $__qname, $attrs);
163: }
164: break;
165: case 2: {
166: if ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
167: .equals("attribute")) || (($__uri
168: .equals("http://www.w3.org/2001/XMLSchema") && $__local
169: .equals("attributeGroup")) || ($__uri
170: .equals("http://www.w3.org/2001/XMLSchema") && $__local
171: .equals("anyAttribute"))))) {
172: NGCCHandler h = new attributeUses(this , super ._source,
173: $runtime, 357, result);
174: spawnChildFromEnterElement(h, $__uri, $__local,
175: $__qname, $attrs);
176: } else {
177: unexpectedEnterElement($__qname);
178: }
179: }
180: break;
181: default: {
182: unexpectedEnterElement($__qname);
183: }
184: break;
185: }
186: }
187:
188: public void leaveElement(String $__uri, String $__local,
189: String $__qname) throws SAXException {
190: int $ai;
191: $uri = $__uri;
192: $localName = $__local;
193: $qname = $__qname;
194: switch ($_ngcc_current_state) {
195: case 4: {
196: $_ngcc_current_state = 3;
197: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
198: $__qname);
199: }
200: break;
201: case 0: {
202: revertToParentFromLeaveElement(result, super ._cookie,
203: $__uri, $__local, $__qname);
204: }
205: break;
206: case 6: {
207: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
208: .equals("attributeGroup"))) {
209: NGCCHandler h = new foreignAttributes(this ,
210: super ._source, $runtime, 362, fa);
211: spawnChildFromLeaveElement(h, $__uri, $__local,
212: $__qname);
213: } else {
214: unexpectedLeaveElement($__qname);
215: }
216: }
217: break;
218: case 7: {
219: if (($ai = $runtime.getAttributeIndex("", "id")) >= 0) {
220: $runtime.consumeAttribute($ai);
221: $runtime.sendLeaveElement(super ._cookie, $__uri,
222: $__local, $__qname);
223: } else {
224: $_ngcc_current_state = 6;
225: $runtime.sendLeaveElement(super ._cookie, $__uri,
226: $__local, $__qname);
227: }
228: }
229: break;
230: case 13: {
231: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
232: $runtime.consumeAttribute($ai);
233: $runtime.sendLeaveElement(super ._cookie, $__uri,
234: $__local, $__qname);
235: } else {
236: unexpectedLeaveElement($__qname);
237: }
238: }
239: break;
240: case 1: {
241: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
242: .equals("attributeGroup"))) {
243: $runtime.onLeaveElementConsumed($__uri, $__local,
244: $__qname);
245: $_ngcc_current_state = 0;
246: } else {
247: unexpectedLeaveElement($__qname);
248: }
249: }
250: break;
251: case 3: {
252: action0();
253: $_ngcc_current_state = 2;
254: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
255: $__qname);
256: }
257: break;
258: case 2: {
259: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
260: .equals("attributeGroup"))) {
261: NGCCHandler h = new attributeUses(this , super ._source,
262: $runtime, 357, result);
263: spawnChildFromLeaveElement(h, $__uri, $__local,
264: $__qname);
265: } else {
266: unexpectedLeaveElement($__qname);
267: }
268: }
269: break;
270: default: {
271: unexpectedLeaveElement($__qname);
272: }
273: break;
274: }
275: }
276:
277: public void enterAttribute(String $__uri, String $__local,
278: String $__qname) throws SAXException {
279: int $ai;
280: $uri = $__uri;
281: $localName = $__local;
282: $qname = $__qname;
283: switch ($_ngcc_current_state) {
284: case 4: {
285: $_ngcc_current_state = 3;
286: $runtime.sendEnterAttribute(super ._cookie, $__uri,
287: $__local, $__qname);
288: }
289: break;
290: case 0: {
291: revertToParentFromEnterAttribute(result, super ._cookie,
292: $__uri, $__local, $__qname);
293: }
294: break;
295: case 7: {
296: if (($__uri.equals("") && $__local.equals("id"))) {
297: $_ngcc_current_state = 9;
298: } else {
299: $_ngcc_current_state = 6;
300: $runtime.sendEnterAttribute(super ._cookie, $__uri,
301: $__local, $__qname);
302: }
303: }
304: break;
305: case 13: {
306: if (($__uri.equals("") && $__local.equals("name"))) {
307: $_ngcc_current_state = 12;
308: } else {
309: unexpectedEnterAttribute($__qname);
310: }
311: }
312: break;
313: case 3: {
314: action0();
315: $_ngcc_current_state = 2;
316: $runtime.sendEnterAttribute(super ._cookie, $__uri,
317: $__local, $__qname);
318: }
319: break;
320: default: {
321: unexpectedEnterAttribute($__qname);
322: }
323: break;
324: }
325: }
326:
327: public void leaveAttribute(String $__uri, String $__local,
328: String $__qname) throws SAXException {
329: int $ai;
330: $uri = $__uri;
331: $localName = $__local;
332: $qname = $__qname;
333: switch ($_ngcc_current_state) {
334: case 8: {
335: if (($__uri.equals("") && $__local.equals("id"))) {
336: $_ngcc_current_state = 6;
337: } else {
338: unexpectedLeaveAttribute($__qname);
339: }
340: }
341: break;
342: case 4: {
343: $_ngcc_current_state = 3;
344: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
345: $__local, $__qname);
346: }
347: break;
348: case 0: {
349: revertToParentFromLeaveAttribute(result, super ._cookie,
350: $__uri, $__local, $__qname);
351: }
352: break;
353: case 7: {
354: $_ngcc_current_state = 6;
355: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
356: $__local, $__qname);
357: }
358: break;
359: case 3: {
360: action0();
361: $_ngcc_current_state = 2;
362: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
363: $__local, $__qname);
364: }
365: break;
366: case 11: {
367: if (($__uri.equals("") && $__local.equals("name"))) {
368: $_ngcc_current_state = 7;
369: } else {
370: unexpectedLeaveAttribute($__qname);
371: }
372: }
373: break;
374: default: {
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 4: {
385: $_ngcc_current_state = 3;
386: $runtime.sendText(super ._cookie, $value);
387: }
388: break;
389: case 0: {
390: revertToParentFromText(result, super ._cookie, $value);
391: }
392: break;
393: case 12: {
394: name = $value;
395: $_ngcc_current_state = 11;
396: }
397: break;
398: case 7: {
399: if (($ai = $runtime.getAttributeIndex("", "id")) >= 0) {
400: $runtime.consumeAttribute($ai);
401: $runtime.sendText(super ._cookie, $value);
402: } else {
403: $_ngcc_current_state = 6;
404: $runtime.sendText(super ._cookie, $value);
405: }
406: }
407: break;
408: case 13: {
409: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
410: $runtime.consumeAttribute($ai);
411: $runtime.sendText(super ._cookie, $value);
412: }
413: }
414: break;
415: case 9: {
416: $_ngcc_current_state = 8;
417: }
418: break;
419: case 3: {
420: action0();
421: $_ngcc_current_state = 2;
422: $runtime.sendText(super ._cookie, $value);
423: }
424: break;
425: }
426: }
427:
428: public void onChildCompleted(Object $__result__, int $__cookie__,
429: boolean $__needAttCheck__) throws SAXException {
430: switch ($__cookie__) {
431: case 360: {
432: annotation = ((AnnotationImpl) $__result__);
433: $_ngcc_current_state = 3;
434: }
435: break;
436: case 362: {
437: fa = ((ForeignAttributesImpl) $__result__);
438: $_ngcc_current_state = 4;
439: }
440: break;
441: case 357: {
442: $_ngcc_current_state = 1;
443: }
444: break;
445: }
446: }
447:
448: public boolean accepted() {
449: return (($_ngcc_current_state == 0));
450: }
451:
452: private AttGroupDeclImpl result;
453: private Locator locator;
454:
455: }
|