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