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