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 complexType_complexContent_body extends NGCCHandler {
044: private AttributesHolder owner;
045: protected final NGCCRuntimeEx $runtime;
046: private int $_ngcc_current_state;
047: protected String $uri;
048: protected String $localName;
049: protected String $qname;
050:
051: public final NGCCRuntime getRuntime() {
052: return ($runtime);
053: }
054:
055: public complexType_complexContent_body(NGCCHandler parent,
056: NGCCEventSource source, NGCCRuntimeEx runtime, int cookie,
057: AttributesHolder _owner) {
058: super (source, parent, cookie);
059: $runtime = runtime;
060: this .owner = _owner;
061: $_ngcc_current_state = 2;
062: }
063:
064: public complexType_complexContent_body(NGCCRuntimeEx runtime,
065: AttributesHolder _owner) {
066: this (null, runtime, runtime, -1, _owner);
067: }
068:
069: private void action0() throws SAXException {
070: if (particle == null)
071: particle = $runtime.parser.schemaSet.empty;
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 1: {
082: if ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
083: .equals("attribute")) || (($__uri
084: .equals("http://www.w3.org/2001/XMLSchema") && $__local
085: .equals("attributeGroup")) || ($__uri
086: .equals("http://www.w3.org/2001/XMLSchema") && $__local
087: .equals("anyAttribute"))))) {
088: NGCCHandler h = new attributeUses(this , super ._source,
089: $runtime, 608, owner);
090: spawnChildFromEnterElement(h, $__uri, $__local,
091: $__qname, $attrs);
092: } else {
093: NGCCHandler h = new attributeUses(this , super ._source,
094: $runtime, 608, owner);
095: spawnChildFromEnterElement(h, $__uri, $__local,
096: $__qname, $attrs);
097: }
098: }
099: break;
100: case 2: {
101: if ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local
102: .equals("all")) || ($__uri
103: .equals("http://www.w3.org/2001/XMLSchema") && $__local
104: .equals("choice"))) || ($__uri
105: .equals("http://www.w3.org/2001/XMLSchema") && $__local
106: .equals("sequence"))) || (($__uri
107: .equals("http://www.w3.org/2001/XMLSchema") && $__local
108: .equals("group")) || (($__uri
109: .equals("http://www.w3.org/2001/XMLSchema") && $__local
110: .equals("element")) || ($__uri
111: .equals("http://www.w3.org/2001/XMLSchema") && $__local
112: .equals("any")))))) {
113: NGCCHandler h = new particle(this , super ._source,
114: $runtime, 610);
115: spawnChildFromEnterElement(h, $__uri, $__local,
116: $__qname, $attrs);
117: } else {
118: $_ngcc_current_state = 1;
119: $runtime.sendEnterElement(super ._cookie, $__uri,
120: $__local, $__qname, $attrs);
121: }
122: }
123: break;
124: case 0: {
125: revertToParentFromEnterElement(particle, super ._cookie,
126: $__uri, $__local, $__qname, $attrs);
127: }
128: break;
129: default: {
130: unexpectedEnterElement($__qname);
131: }
132: break;
133: }
134: }
135:
136: public void leaveElement(String $__uri, String $__local,
137: String $__qname) throws SAXException {
138: int $ai;
139: $uri = $__uri;
140: $localName = $__local;
141: $qname = $__qname;
142: switch ($_ngcc_current_state) {
143: case 1: {
144: NGCCHandler h = new attributeUses(this , super ._source,
145: $runtime, 608, owner);
146: spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
147: }
148: break;
149: case 2: {
150: $_ngcc_current_state = 1;
151: $runtime.sendLeaveElement(super ._cookie, $__uri, $__local,
152: $__qname);
153: }
154: break;
155: case 0: {
156: revertToParentFromLeaveElement(particle, super ._cookie,
157: $__uri, $__local, $__qname);
158: }
159: break;
160: default: {
161: unexpectedLeaveElement($__qname);
162: }
163: break;
164: }
165: }
166:
167: public void enterAttribute(String $__uri, String $__local,
168: String $__qname) throws SAXException {
169: int $ai;
170: $uri = $__uri;
171: $localName = $__local;
172: $qname = $__qname;
173: switch ($_ngcc_current_state) {
174: case 1: {
175: NGCCHandler h = new attributeUses(this , super ._source,
176: $runtime, 608, owner);
177: spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
178: }
179: break;
180: case 2: {
181: $_ngcc_current_state = 1;
182: $runtime.sendEnterAttribute(super ._cookie, $__uri,
183: $__local, $__qname);
184: }
185: break;
186: case 0: {
187: revertToParentFromEnterAttribute(particle, super ._cookie,
188: $__uri, $__local, $__qname);
189: }
190: break;
191: default: {
192: unexpectedEnterAttribute($__qname);
193: }
194: break;
195: }
196: }
197:
198: public void leaveAttribute(String $__uri, String $__local,
199: String $__qname) throws SAXException {
200: int $ai;
201: $uri = $__uri;
202: $localName = $__local;
203: $qname = $__qname;
204: switch ($_ngcc_current_state) {
205: case 1: {
206: NGCCHandler h = new attributeUses(this , super ._source,
207: $runtime, 608, owner);
208: spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
209: }
210: break;
211: case 2: {
212: $_ngcc_current_state = 1;
213: $runtime.sendLeaveAttribute(super ._cookie, $__uri,
214: $__local, $__qname);
215: }
216: break;
217: case 0: {
218: revertToParentFromLeaveAttribute(particle, super ._cookie,
219: $__uri, $__local, $__qname);
220: }
221: break;
222: default: {
223: unexpectedLeaveAttribute($__qname);
224: }
225: break;
226: }
227: }
228:
229: public void text(String $value) throws SAXException {
230: int $ai;
231: switch ($_ngcc_current_state) {
232: case 1: {
233: NGCCHandler h = new attributeUses(this , super ._source,
234: $runtime, 608, owner);
235: spawnChildFromText(h, $value);
236: }
237: break;
238: case 2: {
239: $_ngcc_current_state = 1;
240: $runtime.sendText(super ._cookie, $value);
241: }
242: break;
243: case 0: {
244: revertToParentFromText(particle, super ._cookie, $value);
245: }
246: break;
247: }
248: }
249:
250: public void onChildCompleted(Object $__result__, int $__cookie__,
251: boolean $__needAttCheck__) throws SAXException {
252: switch ($__cookie__) {
253: case 608: {
254: action0();
255: $_ngcc_current_state = 0;
256: }
257: break;
258: case 610: {
259: particle = ((ParticleImpl) $__result__);
260: $_ngcc_current_state = 1;
261: }
262: break;
263: }
264: }
265:
266: public boolean accepted() {
267: return (($_ngcc_current_state == 0));
268: }
269:
270: private ContentTypeImpl particle;
271:
272: }
|