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 SimpleType_List extends NGCCHandler {
019: private Locator locator;
020: private AnnotationImpl annotation;
021: private String name;
022: private UName itemTypeName;
023: private Set finalSet;
024: private ForeignAttributesImpl fa;
025: protected final NGCCRuntimeEx $runtime;
026: private int $_ngcc_current_state;
027: protected String $uri;
028: protected String $localName;
029: protected String $qname;
030:
031: public final NGCCRuntime getRuntime() {
032: return ($runtime);
033: }
034:
035: public SimpleType_List(NGCCHandler parent, NGCCEventSource source,
036: NGCCRuntimeEx runtime, int cookie,
037: AnnotationImpl _annotation, Locator _locator,
038: ForeignAttributesImpl _fa, String _name, Set _finalSet) {
039: super (source, parent, cookie);
040: $runtime = runtime;
041: this .annotation = _annotation;
042: this .locator = _locator;
043: this .fa = _fa;
044: this .name = _name;
045: this .finalSet = _finalSet;
046: $_ngcc_current_state = 10;
047: }
048:
049: public SimpleType_List(NGCCRuntimeEx runtime,
050: AnnotationImpl _annotation, Locator _locator,
051: ForeignAttributesImpl _fa, String _name, Set _finalSet) {
052: this (null, runtime, runtime, -1, _annotation, _locator, _fa,
053: _name, _finalSet);
054: }
055:
056: private void action0() throws SAXException {
057:
058: result = new ListSimpleTypeImpl($runtime.document, annotation,
059: locator, fa, name, name == null, finalSet, itemType);
060:
061: }
062:
063: private void action1() throws SAXException {
064:
065: itemType = new DelayedRef.SimpleType($runtime, lloc,
066: $runtime.currentSchema, itemTypeName);
067:
068: }
069:
070: private void action2() throws SAXException {
071: lloc = $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 2: {
082: if (($ai = $runtime.getAttributeIndex("", "itemType")) >= 0) {
083: $runtime.consumeAttribute($ai);
084: $runtime.sendEnterElement(super ._cookie, $__uri,
085: $__local, $__qname, $attrs);
086: } else {
087: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
088: .equals("simpleType"))) {
089: NGCCHandler h = new simpleType(this , super ._source,
090: $runtime, 166);
091: spawnChildFromEnterElement(h, $__uri, $__local,
092: $__qname, $attrs);
093: } else {
094: unexpectedEnterElement($__qname);
095: }
096: }
097: }
098: break;
099: case 10: {
100: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
101: .equals("list"))) {
102: $runtime.onEnterElementConsumed($__uri, $__local,
103: $__qname, $attrs);
104: action2();
105: $_ngcc_current_state = 9;
106: } else {
107: unexpectedEnterElement($__qname);
108: }
109: }
110: break;
111: case 7: {
112: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
113: .equals("annotation"))) {
114: NGCCHandler h = new annotation(this , super ._source,
115: $runtime, 172, annotation,
116: AnnotationContext.SIMPLETYPE_DECL);
117: spawnChildFromEnterElement(h, $__uri, $__local,
118: $__qname, $attrs);
119: } else {
120: $_ngcc_current_state = 2;
121: $runtime.sendEnterElement(super ._cookie, $__uri,
122: $__local, $__qname, $attrs);
123: }
124: }
125: break;
126: case 0: {
127: revertToParentFromEnterElement(result, super ._cookie,
128: $__uri, $__local, $__qname, $attrs);
129: }
130: break;
131: case 9: {
132: if ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
133: .equals("annotation")) || ((($ai = $runtime
134: .getAttributeIndex("", "itemType")) >= 0 && (($__uri
135: .equals("http://www.w3.org/2001/XMLSchema") && $__local
136: .equals("simpleType")) || ($__uri
137: .equals("http://www.w3.org/2001/XMLSchema") && $__local
138: .equals("annotation")))) || ($__uri
139: .equals("http://www.w3.org/2001/XMLSchema") && $__local
140: .equals("simpleType"))))) {
141: NGCCHandler h = new foreignAttributes(this ,
142: super ._source, $runtime, 174, fa);
143: spawnChildFromEnterElement(h, $__uri, $__local,
144: $__qname, $attrs);
145: } else {
146: unexpectedEnterElement($__qname);
147: }
148: }
149: break;
150: default: {
151: unexpectedEnterElement($__qname);
152: }
153: break;
154: }
155: }
156:
157: public void leaveElement(String $__uri, String $__local,
158: String $__qname) throws SAXException {
159: int $ai;
160: $uri = $__uri;
161: $localName = $__local;
162: $qname = $__qname;
163: switch ($_ngcc_current_state) {
164: case 2: {
165: if (($ai = $runtime.getAttributeIndex("", "itemType")) >= 0) {
166: $runtime.consumeAttribute($ai);
167: $runtime.sendLeaveElement(super ._cookie, $__uri,
168: $__local, $__qname);
169: } else {
170: unexpectedLeaveElement($__qname);
171: }
172: }
173: break;
174: case 1: {
175: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
176: .equals("list"))) {
177: $runtime.onLeaveElementConsumed($__uri, $__local,
178: $__qname);
179: $_ngcc_current_state = 0;
180: action0();
181: } else {
182: unexpectedLeaveElement($__qname);
183: }
184: }
185: break;
186: case 7: {
187: $_ngcc_current_state = 2;
188: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
189: $__qname);
190: }
191: break;
192: case 0: {
193: revertToParentFromLeaveElement(result, super ._cookie,
194: $__uri, $__local, $__qname);
195: }
196: break;
197: case 9: {
198: if ((($ai = $runtime.getAttributeIndex("", "itemType")) >= 0 && ($__uri
199: .equals("http://www.w3.org/2001/XMLSchema") && $__local
200: .equals("list")))) {
201: NGCCHandler h = new foreignAttributes(this ,
202: super ._source, $runtime, 174, fa);
203: spawnChildFromLeaveElement(h, $__uri, $__local,
204: $__qname);
205: } else {
206: unexpectedLeaveElement($__qname);
207: }
208: }
209: break;
210: default: {
211: unexpectedLeaveElement($__qname);
212: }
213: break;
214: }
215: }
216:
217: public void enterAttribute(String $__uri, String $__local,
218: String $__qname) throws SAXException {
219: int $ai;
220: $uri = $__uri;
221: $localName = $__local;
222: $qname = $__qname;
223: switch ($_ngcc_current_state) {
224: case 2: {
225: if (($__uri.equals("") && $__local.equals("itemType"))) {
226: $_ngcc_current_state = 5;
227: } else {
228: unexpectedEnterAttribute($__qname);
229: }
230: }
231: break;
232: case 7: {
233: $_ngcc_current_state = 2;
234: $runtime.sendEnterAttribute(super ._cookie, $__uri,
235: $__local, $__qname);
236: }
237: break;
238: case 0: {
239: revertToParentFromEnterAttribute(result, super ._cookie,
240: $__uri, $__local, $__qname);
241: }
242: break;
243: case 9: {
244: if (($__uri.equals("") && $__local.equals("itemType"))) {
245: NGCCHandler h = new foreignAttributes(this ,
246: super ._source, $runtime, 174, fa);
247: spawnChildFromEnterAttribute(h, $__uri, $__local,
248: $__qname);
249: } else {
250: unexpectedEnterAttribute($__qname);
251: }
252: }
253: break;
254: default: {
255: unexpectedEnterAttribute($__qname);
256: }
257: break;
258: }
259: }
260:
261: public void leaveAttribute(String $__uri, String $__local,
262: String $__qname) throws SAXException {
263: int $ai;
264: $uri = $__uri;
265: $localName = $__local;
266: $qname = $__qname;
267: switch ($_ngcc_current_state) {
268: case 4: {
269: if (($__uri.equals("") && $__local.equals("itemType"))) {
270: $_ngcc_current_state = 1;
271: } else {
272: unexpectedLeaveAttribute($__qname);
273: }
274: }
275: break;
276: case 7: {
277: $_ngcc_current_state = 2;
278: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
279: $__local, $__qname);
280: }
281: break;
282: case 0: {
283: revertToParentFromLeaveAttribute(result, super ._cookie,
284: $__uri, $__local, $__qname);
285: }
286: break;
287: default: {
288: unexpectedLeaveAttribute($__qname);
289: }
290: break;
291: }
292: }
293:
294: public void text(String $value) throws SAXException {
295: int $ai;
296: switch ($_ngcc_current_state) {
297: case 2: {
298: if (($ai = $runtime.getAttributeIndex("", "itemType")) >= 0) {
299: $runtime.consumeAttribute($ai);
300: $runtime.sendText(super ._cookie, $value);
301: }
302: }
303: break;
304: case 5: {
305: NGCCHandler h = new qname(this , super ._source, $runtime,
306: 168);
307: spawnChildFromText(h, $value);
308: }
309: break;
310: case 7: {
311: $_ngcc_current_state = 2;
312: $runtime.sendText(super ._cookie, $value);
313: }
314: break;
315: case 0: {
316: revertToParentFromText(result, super ._cookie, $value);
317: }
318: break;
319: case 9: {
320: if (($ai = $runtime.getAttributeIndex("", "itemType")) >= 0) {
321: NGCCHandler h = new foreignAttributes(this ,
322: super ._source, $runtime, 174, fa);
323: spawnChildFromText(h, $value);
324: }
325: }
326: break;
327: }
328: }
329:
330: public void onChildCompleted(Object $__result__, int $__cookie__,
331: boolean $__needAttCheck__) throws SAXException {
332: switch ($__cookie__) {
333: case 168: {
334: itemTypeName = ((UName) $__result__);
335: action1();
336: $_ngcc_current_state = 4;
337: }
338: break;
339: case 166: {
340: itemType = ((SimpleTypeImpl) $__result__);
341: $_ngcc_current_state = 1;
342: }
343: break;
344: case 172: {
345: annotation = ((AnnotationImpl) $__result__);
346: $_ngcc_current_state = 2;
347: }
348: break;
349: case 174: {
350: fa = ((ForeignAttributesImpl) $__result__);
351: $_ngcc_current_state = 7;
352: }
353: break;
354: }
355: }
356:
357: public boolean accepted() {
358: return (($_ngcc_current_state == 0));
359: }
360:
361: /** computed simple type object */
362: private ListSimpleTypeImpl result;
363:
364: // reference to the base type
365: private Ref.SimpleType itemType;
366:
367: // locator of <list>
368: private Locator lloc;
369:
370: }
|