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