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