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