0001: /*
0002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
0003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0004: *
0005: * This code is free software; you can redistribute it and/or modify it
0006: * under the terms of the GNU General Public License version 2 only, as
0007: * published by the Free Software Foundation. Sun designates this
0008: * particular file as subject to the "Classpath" exception as provided
0009: * by Sun in the LICENSE file that accompanied this code.
0010: *
0011: * This code is distributed in the hope that it will be useful, but WITHOUT
0012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0014: * version 2 for more details (a copy is included in the LICENSE file that
0015: * accompanied this code).
0016: *
0017: * You should have received a copy of the GNU General Public License version
0018: * 2 along with this work; if not, write to the Free Software Foundation,
0019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0020: *
0021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0022: * CA 95054 USA or visit www.sun.com if you need additional information or
0023: * have any questions.
0024: */
0025:
0026: /* this file is generated by RelaxNGCC */
0027: package com.sun.xml.internal.xsom.impl.parser.state;
0028:
0029: import org.xml.sax.SAXException;
0030: import org.xml.sax.XMLReader;
0031: import org.xml.sax.Attributes;
0032: import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
0033:
0034: import com.sun.xml.internal.xsom.*;
0035: import com.sun.xml.internal.xsom.parser.*;
0036: import com.sun.xml.internal.xsom.impl.*;
0037: import com.sun.xml.internal.xsom.impl.parser.*;
0038: import org.xml.sax.Locator;
0039: import org.xml.sax.ContentHandler;
0040: import org.xml.sax.helpers.*;
0041: import java.util.*;
0042:
0043: class elementDeclBody extends NGCCHandler {
0044: private Integer finalValue;
0045: private String name;
0046: private String nillable;
0047: private String abstractValue;
0048: private Integer blockValue;
0049: private ForeignAttributesImpl fa;
0050: private AnnotationImpl annotation;
0051: private Locator locator;
0052: private String defaultValue;
0053: private IdentityConstraintImpl idc;
0054: private boolean isGlobal;
0055: private String fixedValue;
0056: private UName typeName;
0057: private UName substRef;
0058: protected final NGCCRuntimeEx $runtime;
0059: private int $_ngcc_current_state;
0060: protected String $uri;
0061: protected String $localName;
0062: protected String $qname;
0063:
0064: public final NGCCRuntime getRuntime() {
0065: return ($runtime);
0066: }
0067:
0068: public elementDeclBody(NGCCHandler parent, NGCCEventSource source,
0069: NGCCRuntimeEx runtime, int cookie, Locator _locator,
0070: boolean _isGlobal) {
0071: super (source, parent, cookie);
0072: $runtime = runtime;
0073: this .locator = _locator;
0074: this .isGlobal = _isGlobal;
0075: $_ngcc_current_state = 48;
0076: }
0077:
0078: public elementDeclBody(NGCCRuntimeEx runtime, Locator _locator,
0079: boolean _isGlobal) {
0080: this (null, runtime, runtime, -1, _locator, _isGlobal);
0081: }
0082:
0083: private void action0() throws SAXException {
0084: idcs.add(idc);
0085: }
0086:
0087: private void action1() throws SAXException {
0088:
0089: type = new DelayedRef.Type($runtime, locator,
0090: $runtime.currentSchema, typeName);
0091:
0092: }
0093:
0094: private void action2() throws SAXException {
0095:
0096: substHeadRef = new DelayedRef.Element($runtime, locator,
0097: $runtime.currentSchema, substRef);
0098:
0099: }
0100:
0101: private void action3() throws SAXException {
0102: formSpecified = true;
0103: }
0104:
0105: public void enterElement(String $__uri, String $__local,
0106: String $__qname, Attributes $attrs) throws SAXException {
0107: int $ai;
0108: $uri = $__uri;
0109: $localName = $__local;
0110: $qname = $__qname;
0111: switch ($_ngcc_current_state) {
0112: case 3: {
0113: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
0114: .equals("simpleType"))) {
0115: NGCCHandler h = new simpleType(this , super ._source,
0116: $runtime, 412);
0117: spawnChildFromEnterElement(h, $__uri, $__local,
0118: $__qname, $attrs);
0119: } else {
0120: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
0121: .equals("complexType"))) {
0122: NGCCHandler h = new complexType(this ,
0123: super ._source, $runtime, 413);
0124: spawnChildFromEnterElement(h, $__uri, $__local,
0125: $__qname, $attrs);
0126: } else {
0127: if (($ai = $runtime.getAttributeIndex("", "type")) >= 0) {
0128: $runtime.consumeAttribute($ai);
0129: $runtime.sendEnterElement(super ._cookie,
0130: $__uri, $__local, $__qname, $attrs);
0131: } else {
0132: $_ngcc_current_state = 1;
0133: $runtime.sendEnterElement(super ._cookie,
0134: $__uri, $__local, $__qname, $attrs);
0135: }
0136: }
0137: }
0138: }
0139: break;
0140: case 23: {
0141: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
0142: $runtime.consumeAttribute($ai);
0143: $runtime.sendEnterElement(super ._cookie, $__uri,
0144: $__local, $__qname, $attrs);
0145: } else {
0146: unexpectedEnterElement($__qname);
0147: }
0148: }
0149: break;
0150: case 36: {
0151: if (($ai = $runtime.getAttributeIndex("", "final")) >= 0) {
0152: $runtime.consumeAttribute($ai);
0153: $runtime.sendEnterElement(super ._cookie, $__uri,
0154: $__local, $__qname, $attrs);
0155: } else {
0156: $_ngcc_current_state = 32;
0157: $runtime.sendEnterElement(super ._cookie, $__uri,
0158: $__local, $__qname, $attrs);
0159: }
0160: }
0161: break;
0162: case 48: {
0163: if (((($ai = $runtime.getAttributeIndex("", "form")) >= 0 && (((((($__uri
0164: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0165: .equals("key")) || ($__uri
0166: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0167: .equals("keyref"))) || ($__uri
0168: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0169: .equals("unique"))) || ($__uri
0170: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0171: .equals("simpleType"))) || ($__uri
0172: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0173: .equals("complexType"))) || ($__uri
0174: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0175: .equals("annotation")))) || ((($ai = $runtime
0176: .getAttributeIndex("", "default")) >= 0 && (((((($__uri
0177: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0178: .equals("key")) || ($__uri
0179: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0180: .equals("keyref"))) || ($__uri
0181: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0182: .equals("unique"))) || ($__uri
0183: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0184: .equals("simpleType"))) || ($__uri
0185: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0186: .equals("complexType"))) || ($__uri
0187: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0188: .equals("annotation")))) || ((($ai = $runtime
0189: .getAttributeIndex("", "abstract")) >= 0 && (((((($__uri
0190: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0191: .equals("key")) || ($__uri
0192: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0193: .equals("keyref"))) || ($__uri
0194: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0195: .equals("unique"))) || ($__uri
0196: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0197: .equals("simpleType"))) || ($__uri
0198: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0199: .equals("complexType"))) || ($__uri
0200: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0201: .equals("annotation")))) || ((($ai = $runtime
0202: .getAttributeIndex("", "final")) >= 0 && (((((($__uri
0203: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0204: .equals("key")) || ($__uri
0205: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0206: .equals("keyref"))) || ($__uri
0207: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0208: .equals("unique"))) || ($__uri
0209: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0210: .equals("simpleType"))) || ($__uri
0211: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0212: .equals("complexType"))) || ($__uri
0213: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0214: .equals("annotation")))) || ((($ai = $runtime
0215: .getAttributeIndex("", "fixed")) >= 0 && (((((($__uri
0216: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0217: .equals("key")) || ($__uri
0218: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0219: .equals("keyref"))) || ($__uri
0220: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0221: .equals("unique"))) || ($__uri
0222: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0223: .equals("simpleType"))) || ($__uri
0224: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0225: .equals("complexType"))) || ($__uri
0226: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0227: .equals("annotation")))) || ((($ai = $runtime
0228: .getAttributeIndex("", "block")) >= 0 && (((((($__uri
0229: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0230: .equals("key")) || ($__uri
0231: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0232: .equals("keyref"))) || ($__uri
0233: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0234: .equals("unique"))) || ($__uri
0235: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0236: .equals("simpleType"))) || ($__uri
0237: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0238: .equals("complexType"))) || ($__uri
0239: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0240: .equals("annotation")))) || (($ai = $runtime
0241: .getAttributeIndex("", "name")) >= 0 && (((((($__uri
0242: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0243: .equals("key")) || ($__uri
0244: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0245: .equals("keyref"))) || ($__uri
0246: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0247: .equals("unique"))) || ($__uri
0248: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0249: .equals("simpleType"))) || ($__uri
0250: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0251: .equals("complexType"))) || ($__uri
0252: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0253: .equals("annotation"))))))))))) {
0254: NGCCHandler h = new foreignAttributes(this ,
0255: super ._source, $runtime, 462, fa);
0256: spawnChildFromEnterElement(h, $__uri, $__local,
0257: $__qname, $attrs);
0258: } else {
0259: unexpectedEnterElement($__qname);
0260: }
0261: }
0262: break;
0263: case 28: {
0264: if (($ai = $runtime.getAttributeIndex("", "fixed")) >= 0) {
0265: $runtime.consumeAttribute($ai);
0266: $runtime.sendEnterElement(super ._cookie, $__uri,
0267: $__local, $__qname, $attrs);
0268: } else {
0269: $_ngcc_current_state = 24;
0270: $runtime.sendEnterElement(super ._cookie, $__uri,
0271: $__local, $__qname, $attrs);
0272: }
0273: }
0274: break;
0275: case 13: {
0276: if (($ai = $runtime.getAttributeIndex("",
0277: "substitutionGroup")) >= 0) {
0278: $runtime.consumeAttribute($ai);
0279: $runtime.sendEnterElement(super ._cookie, $__uri,
0280: $__local, $__qname, $attrs);
0281: } else {
0282: $_ngcc_current_state = 11;
0283: $runtime.sendEnterElement(super ._cookie, $__uri,
0284: $__local, $__qname, $attrs);
0285: }
0286: }
0287: break;
0288: case 44: {
0289: if (($ai = $runtime.getAttributeIndex("", "abstract")) >= 0) {
0290: $runtime.consumeAttribute($ai);
0291: $runtime.sendEnterElement(super ._cookie, $__uri,
0292: $__local, $__qname, $attrs);
0293: } else {
0294: $_ngcc_current_state = 40;
0295: $runtime.sendEnterElement(super ._cookie, $__uri,
0296: $__local, $__qname, $attrs);
0297: }
0298: }
0299: break;
0300: case 17: {
0301: if (($ai = $runtime.getAttributeIndex("", "nillable")) >= 0) {
0302: $runtime.consumeAttribute($ai);
0303: $runtime.sendEnterElement(super ._cookie, $__uri,
0304: $__local, $__qname, $attrs);
0305: } else {
0306: $_ngcc_current_state = 13;
0307: $runtime.sendEnterElement(super ._cookie, $__uri,
0308: $__local, $__qname, $attrs);
0309: }
0310: }
0311: break;
0312: case 40: {
0313: if (($ai = $runtime.getAttributeIndex("", "block")) >= 0) {
0314: $runtime.consumeAttribute($ai);
0315: $runtime.sendEnterElement(super ._cookie, $__uri,
0316: $__local, $__qname, $attrs);
0317: } else {
0318: $_ngcc_current_state = 36;
0319: $runtime.sendEnterElement(super ._cookie, $__uri,
0320: $__local, $__qname, $attrs);
0321: }
0322: }
0323: break;
0324: case 32: {
0325: if (($ai = $runtime.getAttributeIndex("", "default")) >= 0) {
0326: $runtime.consumeAttribute($ai);
0327: $runtime.sendEnterElement(super ._cookie, $__uri,
0328: $__local, $__qname, $attrs);
0329: } else {
0330: $_ngcc_current_state = 28;
0331: $runtime.sendEnterElement(super ._cookie, $__uri,
0332: $__local, $__qname, $attrs);
0333: }
0334: }
0335: break;
0336: case 11: {
0337: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
0338: .equals("annotation"))) {
0339: NGCCHandler h = new annotation(this , super ._source,
0340: $runtime, 417, null,
0341: AnnotationContext.ELEMENT_DECL);
0342: spawnChildFromEnterElement(h, $__uri, $__local,
0343: $__qname, $attrs);
0344: } else {
0345: $_ngcc_current_state = 3;
0346: $runtime.sendEnterElement(super ._cookie, $__uri,
0347: $__local, $__qname, $attrs);
0348: }
0349: }
0350: break;
0351: case 24: {
0352: if (($ai = $runtime.getAttributeIndex("", "form")) >= 0) {
0353: $runtime.consumeAttribute($ai);
0354: $runtime.sendEnterElement(super ._cookie, $__uri,
0355: $__local, $__qname, $attrs);
0356: } else {
0357: $_ngcc_current_state = 23;
0358: $runtime.sendEnterElement(super ._cookie, $__uri,
0359: $__local, $__qname, $attrs);
0360: }
0361: }
0362: break;
0363: case 1: {
0364: if (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
0365: .equals("key")) || ($__uri
0366: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0367: .equals("keyref"))) || ($__uri
0368: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0369: .equals("unique")))) {
0370: NGCCHandler h = new identityConstraint(this ,
0371: super ._source, $runtime, 400);
0372: spawnChildFromEnterElement(h, $__uri, $__local,
0373: $__qname, $attrs);
0374: } else {
0375: $_ngcc_current_state = 0;
0376: $runtime.sendEnterElement(super ._cookie, $__uri,
0377: $__local, $__qname, $attrs);
0378: }
0379: }
0380: break;
0381: case 0: {
0382: if (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
0383: .equals("key")) || ($__uri
0384: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0385: .equals("keyref"))) || ($__uri
0386: .equals("http://www.w3.org/2001/XMLSchema") && $__local
0387: .equals("unique")))) {
0388: NGCCHandler h = new identityConstraint(this ,
0389: super ._source, $runtime, 399);
0390: spawnChildFromEnterElement(h, $__uri, $__local,
0391: $__qname, $attrs);
0392: } else {
0393: revertToParentFromEnterElement(makeResult(),
0394: super ._cookie, $__uri, $__local, $__qname,
0395: $attrs);
0396: }
0397: }
0398: break;
0399: default: {
0400: unexpectedEnterElement($__qname);
0401: }
0402: break;
0403: }
0404: }
0405:
0406: public void leaveElement(String $__uri, String $__local,
0407: String $__qname) throws SAXException {
0408: int $ai;
0409: $uri = $__uri;
0410: $localName = $__local;
0411: $qname = $__qname;
0412: switch ($_ngcc_current_state) {
0413: case 3: {
0414: if (($ai = $runtime.getAttributeIndex("", "type")) >= 0) {
0415: $runtime.consumeAttribute($ai);
0416: $runtime.sendLeaveElement(super ._cookie, $__uri,
0417: $__local, $__qname);
0418: } else {
0419: $_ngcc_current_state = 1;
0420: $runtime.sendLeaveElement(super ._cookie, $__uri,
0421: $__local, $__qname);
0422: }
0423: }
0424: break;
0425: case 23: {
0426: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
0427: $runtime.consumeAttribute($ai);
0428: $runtime.sendLeaveElement(super ._cookie, $__uri,
0429: $__local, $__qname);
0430: } else {
0431: unexpectedLeaveElement($__qname);
0432: }
0433: }
0434: break;
0435: case 36: {
0436: if (($ai = $runtime.getAttributeIndex("", "final")) >= 0) {
0437: $runtime.consumeAttribute($ai);
0438: $runtime.sendLeaveElement(super ._cookie, $__uri,
0439: $__local, $__qname);
0440: } else {
0441: $_ngcc_current_state = 32;
0442: $runtime.sendLeaveElement(super ._cookie, $__uri,
0443: $__local, $__qname);
0444: }
0445: }
0446: break;
0447: case 48: {
0448: if ((($ai = $runtime.getAttributeIndex("", "form")) >= 0 || (($ai = $runtime
0449: .getAttributeIndex("", "default")) >= 0 || (($ai = $runtime
0450: .getAttributeIndex("", "abstract")) >= 0 || (($ai = $runtime
0451: .getAttributeIndex("", "final")) >= 0 || (($ai = $runtime
0452: .getAttributeIndex("", "fixed")) >= 0 || (($ai = $runtime
0453: .getAttributeIndex("", "block")) >= 0 || ($ai = $runtime
0454: .getAttributeIndex("", "name")) >= 0))))))) {
0455: NGCCHandler h = new foreignAttributes(this ,
0456: super ._source, $runtime, 462, fa);
0457: spawnChildFromLeaveElement(h, $__uri, $__local,
0458: $__qname);
0459: } else {
0460: unexpectedLeaveElement($__qname);
0461: }
0462: }
0463: break;
0464: case 28: {
0465: if (($ai = $runtime.getAttributeIndex("", "fixed")) >= 0) {
0466: $runtime.consumeAttribute($ai);
0467: $runtime.sendLeaveElement(super ._cookie, $__uri,
0468: $__local, $__qname);
0469: } else {
0470: $_ngcc_current_state = 24;
0471: $runtime.sendLeaveElement(super ._cookie, $__uri,
0472: $__local, $__qname);
0473: }
0474: }
0475: break;
0476: case 13: {
0477: if (($ai = $runtime.getAttributeIndex("",
0478: "substitutionGroup")) >= 0) {
0479: $runtime.consumeAttribute($ai);
0480: $runtime.sendLeaveElement(super ._cookie, $__uri,
0481: $__local, $__qname);
0482: } else {
0483: $_ngcc_current_state = 11;
0484: $runtime.sendLeaveElement(super ._cookie, $__uri,
0485: $__local, $__qname);
0486: }
0487: }
0488: break;
0489: case 44: {
0490: if (($ai = $runtime.getAttributeIndex("", "abstract")) >= 0) {
0491: $runtime.consumeAttribute($ai);
0492: $runtime.sendLeaveElement(super ._cookie, $__uri,
0493: $__local, $__qname);
0494: } else {
0495: $_ngcc_current_state = 40;
0496: $runtime.sendLeaveElement(super ._cookie, $__uri,
0497: $__local, $__qname);
0498: }
0499: }
0500: break;
0501: case 17: {
0502: if (($ai = $runtime.getAttributeIndex("", "nillable")) >= 0) {
0503: $runtime.consumeAttribute($ai);
0504: $runtime.sendLeaveElement(super ._cookie, $__uri,
0505: $__local, $__qname);
0506: } else {
0507: $_ngcc_current_state = 13;
0508: $runtime.sendLeaveElement(super ._cookie, $__uri,
0509: $__local, $__qname);
0510: }
0511: }
0512: break;
0513: case 40: {
0514: if (($ai = $runtime.getAttributeIndex("", "block")) >= 0) {
0515: $runtime.consumeAttribute($ai);
0516: $runtime.sendLeaveElement(super ._cookie, $__uri,
0517: $__local, $__qname);
0518: } else {
0519: $_ngcc_current_state = 36;
0520: $runtime.sendLeaveElement(super ._cookie, $__uri,
0521: $__local, $__qname);
0522: }
0523: }
0524: break;
0525: case 32: {
0526: if (($ai = $runtime.getAttributeIndex("", "default")) >= 0) {
0527: $runtime.consumeAttribute($ai);
0528: $runtime.sendLeaveElement(super ._cookie, $__uri,
0529: $__local, $__qname);
0530: } else {
0531: $_ngcc_current_state = 28;
0532: $runtime.sendLeaveElement(super ._cookie, $__uri,
0533: $__local, $__qname);
0534: }
0535: }
0536: break;
0537: case 11: {
0538: $_ngcc_current_state = 3;
0539: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
0540: $__qname);
0541: }
0542: break;
0543: case 24: {
0544: if (($ai = $runtime.getAttributeIndex("", "form")) >= 0) {
0545: $runtime.consumeAttribute($ai);
0546: $runtime.sendLeaveElement(super ._cookie, $__uri,
0547: $__local, $__qname);
0548: } else {
0549: $_ngcc_current_state = 23;
0550: $runtime.sendLeaveElement(super ._cookie, $__uri,
0551: $__local, $__qname);
0552: }
0553: }
0554: break;
0555: case 1: {
0556: $_ngcc_current_state = 0;
0557: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
0558: $__qname);
0559: }
0560: break;
0561: case 0: {
0562: revertToParentFromLeaveElement(makeResult(), super ._cookie,
0563: $__uri, $__local, $__qname);
0564: }
0565: break;
0566: default: {
0567: unexpectedLeaveElement($__qname);
0568: }
0569: break;
0570: }
0571: }
0572:
0573: public void enterAttribute(String $__uri, String $__local,
0574: String $__qname) throws SAXException {
0575: int $ai;
0576: $uri = $__uri;
0577: $localName = $__local;
0578: $qname = $__qname;
0579: switch ($_ngcc_current_state) {
0580: case 3: {
0581: if (($__uri.equals("") && $__local.equals("type"))) {
0582: $_ngcc_current_state = 6;
0583: } else {
0584: $_ngcc_current_state = 1;
0585: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0586: $__local, $__qname);
0587: }
0588: }
0589: break;
0590: case 23: {
0591: if (($__uri.equals("") && $__local.equals("name"))) {
0592: $_ngcc_current_state = 22;
0593: } else {
0594: unexpectedEnterAttribute($__qname);
0595: }
0596: }
0597: break;
0598: case 36: {
0599: if (($__uri.equals("") && $__local.equals("final"))) {
0600: $_ngcc_current_state = 38;
0601: } else {
0602: $_ngcc_current_state = 32;
0603: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0604: $__local, $__qname);
0605: }
0606: }
0607: break;
0608: case 48: {
0609: if ((($__uri.equals("") && $__local.equals("form")) || (($__uri
0610: .equals("") && $__local.equals("default")) || (($__uri
0611: .equals("") && $__local.equals("abstract")) || (($__uri
0612: .equals("") && $__local.equals("final")) || (($__uri
0613: .equals("") && $__local.equals("fixed")) || (($__uri
0614: .equals("") && $__local.equals("block")) || ($__uri
0615: .equals("") && $__local.equals("name"))))))))) {
0616: NGCCHandler h = new foreignAttributes(this ,
0617: super ._source, $runtime, 462, fa);
0618: spawnChildFromEnterAttribute(h, $__uri, $__local,
0619: $__qname);
0620: } else {
0621: unexpectedEnterAttribute($__qname);
0622: }
0623: }
0624: break;
0625: case 28: {
0626: if (($__uri.equals("") && $__local.equals("fixed"))) {
0627: $_ngcc_current_state = 30;
0628: } else {
0629: $_ngcc_current_state = 24;
0630: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0631: $__local, $__qname);
0632: }
0633: }
0634: break;
0635: case 13: {
0636: if (($__uri.equals("") && $__local
0637: .equals("substitutionGroup"))) {
0638: $_ngcc_current_state = 15;
0639: } else {
0640: $_ngcc_current_state = 11;
0641: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0642: $__local, $__qname);
0643: }
0644: }
0645: break;
0646: case 44: {
0647: if (($__uri.equals("") && $__local.equals("abstract"))) {
0648: $_ngcc_current_state = 46;
0649: } else {
0650: $_ngcc_current_state = 40;
0651: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0652: $__local, $__qname);
0653: }
0654: }
0655: break;
0656: case 17: {
0657: if (($__uri.equals("") && $__local.equals("nillable"))) {
0658: $_ngcc_current_state = 19;
0659: } else {
0660: $_ngcc_current_state = 13;
0661: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0662: $__local, $__qname);
0663: }
0664: }
0665: break;
0666: case 40: {
0667: if (($__uri.equals("") && $__local.equals("block"))) {
0668: $_ngcc_current_state = 42;
0669: } else {
0670: $_ngcc_current_state = 36;
0671: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0672: $__local, $__qname);
0673: }
0674: }
0675: break;
0676: case 32: {
0677: if (($__uri.equals("") && $__local.equals("default"))) {
0678: $_ngcc_current_state = 34;
0679: } else {
0680: $_ngcc_current_state = 28;
0681: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0682: $__local, $__qname);
0683: }
0684: }
0685: break;
0686: case 11: {
0687: $_ngcc_current_state = 3;
0688: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0689: $__local, $__qname);
0690: }
0691: break;
0692: case 24: {
0693: if (($__uri.equals("") && $__local.equals("form"))) {
0694: $_ngcc_current_state = 26;
0695: } else {
0696: $_ngcc_current_state = 23;
0697: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0698: $__local, $__qname);
0699: }
0700: }
0701: break;
0702: case 1: {
0703: $_ngcc_current_state = 0;
0704: $runtime.sendEnterAttribute(super ._cookie, $__uri,
0705: $__local, $__qname);
0706: }
0707: break;
0708: case 0: {
0709: revertToParentFromEnterAttribute(makeResult(),
0710: super ._cookie, $__uri, $__local, $__qname);
0711: }
0712: break;
0713: default: {
0714: unexpectedEnterAttribute($__qname);
0715: }
0716: break;
0717: }
0718: }
0719:
0720: public void leaveAttribute(String $__uri, String $__local,
0721: String $__qname) throws SAXException {
0722: int $ai;
0723: $uri = $__uri;
0724: $localName = $__local;
0725: $qname = $__qname;
0726: switch ($_ngcc_current_state) {
0727: case 3: {
0728: $_ngcc_current_state = 1;
0729: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0730: $__local, $__qname);
0731: }
0732: break;
0733: case 14: {
0734: if (($__uri.equals("") && $__local
0735: .equals("substitutionGroup"))) {
0736: $_ngcc_current_state = 11;
0737: } else {
0738: unexpectedLeaveAttribute($__qname);
0739: }
0740: }
0741: break;
0742: case 45: {
0743: if (($__uri.equals("") && $__local.equals("abstract"))) {
0744: $_ngcc_current_state = 40;
0745: } else {
0746: unexpectedLeaveAttribute($__qname);
0747: }
0748: }
0749: break;
0750: case 36: {
0751: $_ngcc_current_state = 32;
0752: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0753: $__local, $__qname);
0754: }
0755: break;
0756: case 28: {
0757: $_ngcc_current_state = 24;
0758: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0759: $__local, $__qname);
0760: }
0761: break;
0762: case 33: {
0763: if (($__uri.equals("") && $__local.equals("default"))) {
0764: $_ngcc_current_state = 28;
0765: } else {
0766: unexpectedLeaveAttribute($__qname);
0767: }
0768: }
0769: break;
0770: case 25: {
0771: if (($__uri.equals("") && $__local.equals("form"))) {
0772: $_ngcc_current_state = 23;
0773: } else {
0774: unexpectedLeaveAttribute($__qname);
0775: }
0776: }
0777: break;
0778: case 29: {
0779: if (($__uri.equals("") && $__local.equals("fixed"))) {
0780: $_ngcc_current_state = 24;
0781: } else {
0782: unexpectedLeaveAttribute($__qname);
0783: }
0784: }
0785: break;
0786: case 37: {
0787: if (($__uri.equals("") && $__local.equals("final"))) {
0788: $_ngcc_current_state = 32;
0789: } else {
0790: unexpectedLeaveAttribute($__qname);
0791: }
0792: }
0793: break;
0794: case 13: {
0795: $_ngcc_current_state = 11;
0796: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0797: $__local, $__qname);
0798: }
0799: break;
0800: case 44: {
0801: $_ngcc_current_state = 40;
0802: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0803: $__local, $__qname);
0804: }
0805: break;
0806: case 18: {
0807: if (($__uri.equals("") && $__local.equals("nillable"))) {
0808: $_ngcc_current_state = 13;
0809: } else {
0810: unexpectedLeaveAttribute($__qname);
0811: }
0812: }
0813: break;
0814: case 17: {
0815: $_ngcc_current_state = 13;
0816: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0817: $__local, $__qname);
0818: }
0819: break;
0820: case 40: {
0821: $_ngcc_current_state = 36;
0822: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0823: $__local, $__qname);
0824: }
0825: break;
0826: case 41: {
0827: if (($__uri.equals("") && $__local.equals("block"))) {
0828: $_ngcc_current_state = 36;
0829: } else {
0830: unexpectedLeaveAttribute($__qname);
0831: }
0832: }
0833: break;
0834: case 5: {
0835: if (($__uri.equals("") && $__local.equals("type"))) {
0836: $_ngcc_current_state = 1;
0837: action1();
0838: } else {
0839: unexpectedLeaveAttribute($__qname);
0840: }
0841: }
0842: break;
0843: case 32: {
0844: $_ngcc_current_state = 28;
0845: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0846: $__local, $__qname);
0847: }
0848: break;
0849: case 24: {
0850: $_ngcc_current_state = 23;
0851: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0852: $__local, $__qname);
0853: }
0854: break;
0855: case 11: {
0856: $_ngcc_current_state = 3;
0857: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0858: $__local, $__qname);
0859: }
0860: break;
0861: case 1: {
0862: $_ngcc_current_state = 0;
0863: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
0864: $__local, $__qname);
0865: }
0866: break;
0867: case 0: {
0868: revertToParentFromLeaveAttribute(makeResult(),
0869: super ._cookie, $__uri, $__local, $__qname);
0870: }
0871: break;
0872: case 21: {
0873: if (($__uri.equals("") && $__local.equals("name"))) {
0874: $_ngcc_current_state = 17;
0875: } else {
0876: unexpectedLeaveAttribute($__qname);
0877: }
0878: }
0879: break;
0880: default: {
0881: unexpectedLeaveAttribute($__qname);
0882: }
0883: break;
0884: }
0885: }
0886:
0887: public void text(String $value) throws SAXException {
0888: int $ai;
0889: switch ($_ngcc_current_state) {
0890: case 38: {
0891: NGCCHandler h = new erSet(this , super ._source, $runtime,
0892: 448);
0893: spawnChildFromText(h, $value);
0894: }
0895: break;
0896: case 3: {
0897: if (($ai = $runtime.getAttributeIndex("", "type")) >= 0) {
0898: $runtime.consumeAttribute($ai);
0899: $runtime.sendText(super ._cookie, $value);
0900: } else {
0901: $_ngcc_current_state = 1;
0902: $runtime.sendText(super ._cookie, $value);
0903: }
0904: }
0905: break;
0906: case 6: {
0907: NGCCHandler h = new qname(this , super ._source, $runtime,
0908: 403);
0909: spawnChildFromText(h, $value);
0910: }
0911: break;
0912: case 46: {
0913: abstractValue = $value;
0914: $_ngcc_current_state = 45;
0915: }
0916: break;
0917: case 26: {
0918: if ($value.equals("unqualified")) {
0919: NGCCHandler h = new qualification(this , super ._source,
0920: $runtime, 433);
0921: spawnChildFromText(h, $value);
0922: } else {
0923: if ($value.equals("qualified")) {
0924: NGCCHandler h = new qualification(this ,
0925: super ._source, $runtime, 433);
0926: spawnChildFromText(h, $value);
0927: }
0928: }
0929: }
0930: break;
0931: case 23: {
0932: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
0933: $runtime.consumeAttribute($ai);
0934: $runtime.sendText(super ._cookie, $value);
0935: }
0936: }
0937: break;
0938: case 15: {
0939: NGCCHandler h = new qname(this , super ._source, $runtime,
0940: 420);
0941: spawnChildFromText(h, $value);
0942: }
0943: break;
0944: case 48: {
0945: if (($ai = $runtime.getAttributeIndex("", "name")) >= 0) {
0946: NGCCHandler h = new foreignAttributes(this ,
0947: super ._source, $runtime, 462, fa);
0948: spawnChildFromText(h, $value);
0949: } else {
0950: if (($ai = $runtime.getAttributeIndex("", "block")) >= 0) {
0951: NGCCHandler h = new foreignAttributes(this ,
0952: super ._source, $runtime, 462, fa);
0953: spawnChildFromText(h, $value);
0954: } else {
0955: if (($ai = $runtime.getAttributeIndex("", "fixed")) >= 0) {
0956: NGCCHandler h = new foreignAttributes(this ,
0957: super ._source, $runtime, 462, fa);
0958: spawnChildFromText(h, $value);
0959: } else {
0960: if (($ai = $runtime.getAttributeIndex("",
0961: "final")) >= 0) {
0962: NGCCHandler h = new foreignAttributes(this ,
0963: super ._source, $runtime, 462, fa);
0964: spawnChildFromText(h, $value);
0965: } else {
0966: if (($ai = $runtime.getAttributeIndex("",
0967: "abstract")) >= 0) {
0968: NGCCHandler h = new foreignAttributes(
0969: this , super ._source, $runtime,
0970: 462, fa);
0971: spawnChildFromText(h, $value);
0972: } else {
0973: if (($ai = $runtime.getAttributeIndex(
0974: "", "default")) >= 0) {
0975: NGCCHandler h = new foreignAttributes(
0976: this , super ._source,
0977: $runtime, 462, fa);
0978: spawnChildFromText(h, $value);
0979: } else {
0980: if (($ai = $runtime
0981: .getAttributeIndex("",
0982: "form")) >= 0) {
0983: NGCCHandler h = new foreignAttributes(
0984: this , super ._source,
0985: $runtime, 462, fa);
0986: spawnChildFromText(h, $value);
0987: }
0988: }
0989: }
0990: }
0991: }
0992: }
0993: }
0994: }
0995: break;
0996: case 36: {
0997: if (($ai = $runtime.getAttributeIndex("", "final")) >= 0) {
0998: $runtime.consumeAttribute($ai);
0999: $runtime.sendText(super ._cookie, $value);
1000: } else {
1001: $_ngcc_current_state = 32;
1002: $runtime.sendText(super ._cookie, $value);
1003: }
1004: }
1005: break;
1006: case 28: {
1007: if (($ai = $runtime.getAttributeIndex("", "fixed")) >= 0) {
1008: $runtime.consumeAttribute($ai);
1009: $runtime.sendText(super ._cookie, $value);
1010: } else {
1011: $_ngcc_current_state = 24;
1012: $runtime.sendText(super ._cookie, $value);
1013: }
1014: }
1015: break;
1016: case 13: {
1017: if (($ai = $runtime.getAttributeIndex("",
1018: "substitutionGroup")) >= 0) {
1019: $runtime.consumeAttribute($ai);
1020: $runtime.sendText(super ._cookie, $value);
1021: } else {
1022: $_ngcc_current_state = 11;
1023: $runtime.sendText(super ._cookie, $value);
1024: }
1025: }
1026: break;
1027: case 19: {
1028: nillable = $value;
1029: $_ngcc_current_state = 18;
1030: }
1031: break;
1032: case 34: {
1033: defaultValue = $value;
1034: $_ngcc_current_state = 33;
1035: }
1036: break;
1037: case 44: {
1038: if (($ai = $runtime.getAttributeIndex("", "abstract")) >= 0) {
1039: $runtime.consumeAttribute($ai);
1040: $runtime.sendText(super ._cookie, $value);
1041: } else {
1042: $_ngcc_current_state = 40;
1043: $runtime.sendText(super ._cookie, $value);
1044: }
1045: }
1046: break;
1047: case 22: {
1048: name = $value;
1049: $_ngcc_current_state = 21;
1050: }
1051: break;
1052: case 17: {
1053: if (($ai = $runtime.getAttributeIndex("", "nillable")) >= 0) {
1054: $runtime.consumeAttribute($ai);
1055: $runtime.sendText(super ._cookie, $value);
1056: } else {
1057: $_ngcc_current_state = 13;
1058: $runtime.sendText(super ._cookie, $value);
1059: }
1060: }
1061: break;
1062: case 40: {
1063: if (($ai = $runtime.getAttributeIndex("", "block")) >= 0) {
1064: $runtime.consumeAttribute($ai);
1065: $runtime.sendText(super ._cookie, $value);
1066: } else {
1067: $_ngcc_current_state = 36;
1068: $runtime.sendText(super ._cookie, $value);
1069: }
1070: }
1071: break;
1072: case 30: {
1073: fixedValue = $value;
1074: $_ngcc_current_state = 29;
1075: }
1076: break;
1077: case 32: {
1078: if (($ai = $runtime.getAttributeIndex("", "default")) >= 0) {
1079: $runtime.consumeAttribute($ai);
1080: $runtime.sendText(super ._cookie, $value);
1081: } else {
1082: $_ngcc_current_state = 28;
1083: $runtime.sendText(super ._cookie, $value);
1084: }
1085: }
1086: break;
1087: case 42: {
1088: NGCCHandler h = new ersSet(this , super ._source, $runtime,
1089: 453);
1090: spawnChildFromText(h, $value);
1091: }
1092: break;
1093: case 24: {
1094: if (($ai = $runtime.getAttributeIndex("", "form")) >= 0) {
1095: $runtime.consumeAttribute($ai);
1096: $runtime.sendText(super ._cookie, $value);
1097: } else {
1098: $_ngcc_current_state = 23;
1099: $runtime.sendText(super ._cookie, $value);
1100: }
1101: }
1102: break;
1103: case 11: {
1104: $_ngcc_current_state = 3;
1105: $runtime.sendText(super ._cookie, $value);
1106: }
1107: break;
1108: case 1: {
1109: $_ngcc_current_state = 0;
1110: $runtime.sendText(super ._cookie, $value);
1111: }
1112: break;
1113: case 0: {
1114: revertToParentFromText(makeResult(), super ._cookie, $value);
1115: }
1116: break;
1117: }
1118: }
1119:
1120: public void onChildCompleted(Object $__result__, int $__cookie__,
1121: boolean $__needAttCheck__) throws SAXException {
1122: switch ($__cookie__) {
1123: case 412: {
1124: type = ((SimpleTypeImpl) $__result__);
1125: $_ngcc_current_state = 1;
1126: }
1127: break;
1128: case 413: {
1129: type = ((ComplexTypeImpl) $__result__);
1130: $_ngcc_current_state = 1;
1131: }
1132: break;
1133: case 453: {
1134: blockValue = ((Integer) $__result__);
1135: $_ngcc_current_state = 41;
1136: }
1137: break;
1138: case 417: {
1139: annotation = ((AnnotationImpl) $__result__);
1140: $_ngcc_current_state = 3;
1141: }
1142: break;
1143: case 400: {
1144: idc = ((IdentityConstraintImpl) $__result__);
1145: action0();
1146: $_ngcc_current_state = 0;
1147: }
1148: break;
1149: case 448: {
1150: finalValue = ((Integer) $__result__);
1151: $_ngcc_current_state = 37;
1152: }
1153: break;
1154: case 403: {
1155: typeName = ((UName) $__result__);
1156: $_ngcc_current_state = 5;
1157: }
1158: break;
1159: case 433: {
1160: form = ((Boolean) $__result__).booleanValue();
1161: action3();
1162: $_ngcc_current_state = 25;
1163: }
1164: break;
1165: case 462: {
1166: fa = ((ForeignAttributesImpl) $__result__);
1167: $_ngcc_current_state = 44;
1168: }
1169: break;
1170: case 420: {
1171: substRef = ((UName) $__result__);
1172: action2();
1173: $_ngcc_current_state = 14;
1174: }
1175: break;
1176: case 399: {
1177: idc = ((IdentityConstraintImpl) $__result__);
1178: action0();
1179: $_ngcc_current_state = 0;
1180: }
1181: break;
1182: }
1183: }
1184:
1185: public boolean accepted() {
1186: return ((($_ngcc_current_state == 0) || (($_ngcc_current_state == 17) || (($_ngcc_current_state == 13) || (($_ngcc_current_state == 1) || (($_ngcc_current_state == 11) || ($_ngcc_current_state == 3)))))));
1187: }
1188:
1189: private boolean form;
1190: private boolean formSpecified;
1191: private Ref.Type type;
1192: private List idcs = new ArrayList(); // identity constraints
1193:
1194: private DelayedRef.Element substHeadRef;
1195:
1196: private ElementDecl makeResult() {
1197: if (finalValue == null)
1198: finalValue = new Integer($runtime.finalDefault);
1199: if (blockValue == null)
1200: blockValue = new Integer($runtime.blockDefault);
1201:
1202: if (!formSpecified)
1203: form = $runtime.elementFormDefault;
1204: if (isGlobal) // global elements are always qualified
1205: form = true;
1206:
1207: String tns;
1208: if (form)
1209: tns = $runtime.currentSchema.getTargetNamespace();
1210: else
1211: tns = "";
1212:
1213: if (type == null) {
1214: if (substHeadRef != null)
1215: type = new SubstGroupBaseTypeRef(substHeadRef);
1216: else
1217: type = $runtime.parser.schemaSet.anyType;
1218: }
1219:
1220: ElementDecl ed = new ElementDecl($runtime, $runtime.document,
1221: annotation, locator, fa, tns, name, !isGlobal, $runtime
1222: .createXmlString(defaultValue), $runtime
1223: .createXmlString(fixedValue), $runtime
1224: .parseBoolean(nillable), $runtime
1225: .parseBoolean(abstractValue), type,
1226: substHeadRef, blockValue.intValue(), finalValue
1227: .intValue(), idcs);
1228:
1229: // if this element has anonymous complex type, it will be set here.
1230: if (type instanceof ComplexTypeImpl)
1231: ((ComplexTypeImpl) type).setScope(ed);
1232: return ed;
1233: }
1234:
1235: }
|