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 includeDecl extends NGCCHandler {
019: private String schemaLocation;
020: protected final NGCCRuntimeEx $runtime;
021: private int $_ngcc_current_state;
022: protected String $uri;
023: protected String $localName;
024: protected String $qname;
025:
026: public final NGCCRuntime getRuntime() {
027: return ($runtime);
028: }
029:
030: public includeDecl(NGCCHandler parent, NGCCEventSource source,
031: NGCCRuntimeEx runtime, int cookie) {
032: super (source, parent, cookie);
033: $runtime = runtime;
034: $_ngcc_current_state = 7;
035: }
036:
037: public includeDecl(NGCCRuntimeEx runtime) {
038: this (null, runtime, runtime, -1);
039: }
040:
041: private void action0() throws SAXException {
042: $runtime.includeSchema(schemaLocation);
043: }
044:
045: public void enterElement(String $__uri, String $__local,
046: String $__qname, Attributes $attrs) throws SAXException {
047: int $ai;
048: $uri = $__uri;
049: $localName = $__local;
050: $qname = $__qname;
051: switch ($_ngcc_current_state) {
052: case 0: {
053: revertToParentFromEnterElement(this , super ._cookie, $__uri,
054: $__local, $__qname, $attrs);
055: }
056: break;
057: case 6: {
058: if (($ai = $runtime.getAttributeIndex("", "schemaLocation")) >= 0) {
059: $runtime.consumeAttribute($ai);
060: $runtime.sendEnterElement(super ._cookie, $__uri,
061: $__local, $__qname, $attrs);
062: } else {
063: unexpectedEnterElement($__qname);
064: }
065: }
066: break;
067: case 7: {
068: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
069: .equals("include"))) {
070: $runtime.onEnterElementConsumed($__uri, $__local,
071: $__qname, $attrs);
072: $_ngcc_current_state = 6;
073: } else {
074: unexpectedEnterElement($__qname);
075: }
076: }
077: break;
078: case 2: {
079: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
080: .equals("annotation"))) {
081: NGCCHandler h = new annotation(this , super ._source,
082: $runtime, 521, null, AnnotationContext.SCHEMA);
083: spawnChildFromEnterElement(h, $__uri, $__local,
084: $__qname, $attrs);
085: } else {
086: $_ngcc_current_state = 1;
087: $runtime.sendEnterElement(super ._cookie, $__uri,
088: $__local, $__qname, $attrs);
089: }
090: }
091: break;
092: default: {
093: unexpectedEnterElement($__qname);
094: }
095: break;
096: }
097: }
098:
099: public void leaveElement(String $__uri, String $__local,
100: String $__qname) throws SAXException {
101: int $ai;
102: $uri = $__uri;
103: $localName = $__local;
104: $qname = $__qname;
105: switch ($_ngcc_current_state) {
106: case 0: {
107: revertToParentFromLeaveElement(this , super ._cookie, $__uri,
108: $__local, $__qname);
109: }
110: break;
111: case 1: {
112: if (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
113: .equals("include"))) {
114: $runtime.onLeaveElementConsumed($__uri, $__local,
115: $__qname);
116: $_ngcc_current_state = 0;
117: action0();
118: } else {
119: unexpectedLeaveElement($__qname);
120: }
121: }
122: break;
123: case 6: {
124: if (($ai = $runtime.getAttributeIndex("", "schemaLocation")) >= 0) {
125: $runtime.consumeAttribute($ai);
126: $runtime.sendLeaveElement(super ._cookie, $__uri,
127: $__local, $__qname);
128: } else {
129: unexpectedLeaveElement($__qname);
130: }
131: }
132: break;
133: case 2: {
134: $_ngcc_current_state = 1;
135: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
136: $__qname);
137: }
138: break;
139: default: {
140: unexpectedLeaveElement($__qname);
141: }
142: break;
143: }
144: }
145:
146: public void enterAttribute(String $__uri, String $__local,
147: String $__qname) throws SAXException {
148: int $ai;
149: $uri = $__uri;
150: $localName = $__local;
151: $qname = $__qname;
152: switch ($_ngcc_current_state) {
153: case 0: {
154: revertToParentFromEnterAttribute(this , super ._cookie,
155: $__uri, $__local, $__qname);
156: }
157: break;
158: case 6: {
159: if (($__uri.equals("") && $__local.equals("schemaLocation"))) {
160: $_ngcc_current_state = 5;
161: } else {
162: unexpectedEnterAttribute($__qname);
163: }
164: }
165: break;
166: case 2: {
167: $_ngcc_current_state = 1;
168: $runtime.sendEnterAttribute(super ._cookie, $__uri,
169: $__local, $__qname);
170: }
171: break;
172: default: {
173: unexpectedEnterAttribute($__qname);
174: }
175: break;
176: }
177: }
178:
179: public void leaveAttribute(String $__uri, String $__local,
180: String $__qname) throws SAXException {
181: int $ai;
182: $uri = $__uri;
183: $localName = $__local;
184: $qname = $__qname;
185: switch ($_ngcc_current_state) {
186: case 0: {
187: revertToParentFromLeaveAttribute(this , super ._cookie,
188: $__uri, $__local, $__qname);
189: }
190: break;
191: case 4: {
192: if (($__uri.equals("") && $__local.equals("schemaLocation"))) {
193: $_ngcc_current_state = 2;
194: } else {
195: unexpectedLeaveAttribute($__qname);
196: }
197: }
198: break;
199: case 2: {
200: $_ngcc_current_state = 1;
201: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
202: $__local, $__qname);
203: }
204: break;
205: default: {
206: unexpectedLeaveAttribute($__qname);
207: }
208: break;
209: }
210: }
211:
212: public void text(String $value) throws SAXException {
213: int $ai;
214: switch ($_ngcc_current_state) {
215: case 0: {
216: revertToParentFromText(this , super ._cookie, $value);
217: }
218: break;
219: case 6: {
220: if (($ai = $runtime.getAttributeIndex("", "schemaLocation")) >= 0) {
221: $runtime.consumeAttribute($ai);
222: $runtime.sendText(super ._cookie, $value);
223: }
224: }
225: break;
226: case 5: {
227: schemaLocation = $value;
228: $_ngcc_current_state = 4;
229: }
230: break;
231: case 2: {
232: $_ngcc_current_state = 1;
233: $runtime.sendText(super ._cookie, $value);
234: }
235: break;
236: }
237: }
238:
239: public void onChildCompleted(Object $__result__, int $__cookie__,
240: boolean $__needAttCheck__) throws SAXException {
241: switch ($__cookie__) {
242: case 521: {
243: $_ngcc_current_state = 1;
244: }
245: break;
246: }
247: }
248:
249: public boolean accepted() {
250: return (($_ngcc_current_state == 0));
251: }
252:
253: }
|