aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: /* this file is generated by RelaxNGCC */ aoqi@0: package com.sun.xml.internal.xsom.impl.parser.state; aoqi@0: import org.xml.sax.SAXException; aoqi@0: import org.xml.sax.XMLReader; aoqi@0: import org.xml.sax.Attributes; aoqi@0: import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; aoqi@0: aoqi@0: import com.sun.xml.internal.xsom.*; aoqi@0: import com.sun.xml.internal.xsom.parser.*; aoqi@0: import com.sun.xml.internal.xsom.impl.*; aoqi@0: import com.sun.xml.internal.xsom.impl.parser.*; aoqi@0: import org.xml.sax.Locator; aoqi@0: import org.xml.sax.ContentHandler; aoqi@0: import org.xml.sax.helpers.*; aoqi@0: import java.util.*; aoqi@0: import java.math.BigInteger; aoqi@0: aoqi@0: import java.util.Vector; aoqi@0: aoqi@0: aoqi@0: class SimpleType_Union extends NGCCHandler { aoqi@0: private Locator locator; aoqi@0: private AnnotationImpl annotation; aoqi@0: private String __text; aoqi@0: private UName memberTypeName; aoqi@0: private String name; aoqi@0: private Set finalSet; aoqi@0: private ForeignAttributesImpl fa; aoqi@0: private SimpleTypeImpl anonymousMemberType; aoqi@0: protected final NGCCRuntimeEx $runtime; aoqi@0: private int $_ngcc_current_state; aoqi@0: protected String $uri; aoqi@0: protected String $localName; aoqi@0: protected String $qname; aoqi@0: aoqi@0: public final NGCCRuntime getRuntime() { aoqi@0: return($runtime); aoqi@0: } aoqi@0: aoqi@0: public SimpleType_Union(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { aoqi@0: super(source, parent, cookie); aoqi@0: $runtime = runtime; aoqi@0: this.annotation = _annotation; aoqi@0: this.locator = _locator; aoqi@0: this.fa = _fa; aoqi@0: this.name = _name; aoqi@0: this.finalSet = _finalSet; aoqi@0: $_ngcc_current_state = 12; aoqi@0: } aoqi@0: aoqi@0: public SimpleType_Union(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { aoqi@0: this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet); aoqi@0: } aoqi@0: aoqi@0: private void action0()throws SAXException { aoqi@0: aoqi@0: result = new UnionSimpleTypeImpl( aoqi@0: $runtime.document, annotation, locator, fa, name, name==null, finalSet, aoqi@0: (Ref.SimpleType[])members.toArray(new Ref.SimpleType[members.size()]) ); aoqi@0: aoqi@0: } aoqi@0: aoqi@0: private void action1()throws SAXException { aoqi@0: aoqi@0: members.add(anonymousMemberType); aoqi@0: aoqi@0: } aoqi@0: aoqi@0: private void action2()throws SAXException { aoqi@0: aoqi@0: members.add( new DelayedRef.SimpleType( aoqi@0: $runtime, uloc, $runtime.currentSchema, memberTypeName)); aoqi@0: aoqi@0: } aoqi@0: aoqi@0: private void action3()throws SAXException { aoqi@0: $runtime.processList(__text);} aoqi@0: aoqi@0: private void action4()throws SAXException { aoqi@0: uloc=$runtime.copyLocator(); aoqi@0: } aoqi@0: aoqi@0: public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { aoqi@0: int $ai; aoqi@0: $uri = $__uri; aoqi@0: $localName = $__local; aoqi@0: $qname = $__qname; aoqi@0: switch($_ngcc_current_state) { aoqi@0: case 4: aoqi@0: { aoqi@0: if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { aoqi@0: NGCCHandler h = new annotation(this, super._source, $runtime, 183, annotation,AnnotationContext.SIMPLETYPE_DECL); aoqi@0: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: else { aoqi@0: $_ngcc_current_state = 2; aoqi@0: $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 0: aoqi@0: { aoqi@0: revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: break; aoqi@0: case 1: aoqi@0: { aoqi@0: if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { aoqi@0: NGCCHandler h = new simpleType(this, super._source, $runtime, 179); aoqi@0: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: else { aoqi@0: unexpectedEnterElement($__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 7: aoqi@0: { aoqi@0: if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) { aoqi@0: $runtime.consumeAttribute($ai); aoqi@0: $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: else { aoqi@0: $_ngcc_current_state = 6; aoqi@0: $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 12: aoqi@0: { aoqi@0: if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) { aoqi@0: $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); aoqi@0: action4(); aoqi@0: $_ngcc_current_state = 7; aoqi@0: } aoqi@0: else { aoqi@0: unexpectedEnterElement($__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 2: aoqi@0: { aoqi@0: if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { aoqi@0: NGCCHandler h = new simpleType(this, super._source, $runtime, 180); aoqi@0: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: else { aoqi@0: $_ngcc_current_state = 1; aoqi@0: $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 6: aoqi@0: { aoqi@0: if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) { aoqi@0: NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 185, fa); aoqi@0: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); aoqi@0: } aoqi@0: else { aoqi@0: unexpectedEnterElement($__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: default: aoqi@0: { aoqi@0: unexpectedEnterElement($__qname); aoqi@0: } aoqi@0: break; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { aoqi@0: int $ai; aoqi@0: $uri = $__uri; aoqi@0: $localName = $__local; aoqi@0: $qname = $__qname; aoqi@0: switch($_ngcc_current_state) { aoqi@0: case 4: aoqi@0: { aoqi@0: $_ngcc_current_state = 2; aoqi@0: $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 0: aoqi@0: { aoqi@0: revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 1: aoqi@0: { aoqi@0: if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) { aoqi@0: $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); aoqi@0: $_ngcc_current_state = 0; aoqi@0: action0(); aoqi@0: } aoqi@0: else { aoqi@0: unexpectedLeaveElement($__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 7: aoqi@0: { aoqi@0: if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) { aoqi@0: $runtime.consumeAttribute($ai); aoqi@0: $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: else { aoqi@0: $_ngcc_current_state = 6; aoqi@0: $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 2: aoqi@0: { aoqi@0: $_ngcc_current_state = 1; aoqi@0: $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 6: aoqi@0: { aoqi@0: if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) { aoqi@0: NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 185, fa); aoqi@0: spawnChildFromLeaveElement(h, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: else { aoqi@0: unexpectedLeaveElement($__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: default: aoqi@0: { aoqi@0: unexpectedLeaveElement($__qname); aoqi@0: } aoqi@0: break; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { aoqi@0: int $ai; aoqi@0: $uri = $__uri; aoqi@0: $localName = $__local; aoqi@0: $qname = $__qname; aoqi@0: switch($_ngcc_current_state) { aoqi@0: case 4: aoqi@0: { aoqi@0: $_ngcc_current_state = 2; aoqi@0: $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 0: aoqi@0: { aoqi@0: revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 7: aoqi@0: { aoqi@0: if(($__uri.equals("") && $__local.equals("memberTypes"))) { aoqi@0: $_ngcc_current_state = 10; aoqi@0: } aoqi@0: else { aoqi@0: $_ngcc_current_state = 6; aoqi@0: $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 2: aoqi@0: { aoqi@0: $_ngcc_current_state = 1; aoqi@0: $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: default: aoqi@0: { aoqi@0: unexpectedEnterAttribute($__qname); aoqi@0: } aoqi@0: break; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { aoqi@0: int $ai; aoqi@0: $uri = $__uri; aoqi@0: $localName = $__local; aoqi@0: $qname = $__qname; aoqi@0: switch($_ngcc_current_state) { aoqi@0: case 4: aoqi@0: { aoqi@0: $_ngcc_current_state = 2; aoqi@0: $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 0: aoqi@0: { aoqi@0: revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 7: aoqi@0: { aoqi@0: $_ngcc_current_state = 6; aoqi@0: $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: case 8: aoqi@0: { aoqi@0: if(($__uri.equals("") && $__local.equals("memberTypes"))) { aoqi@0: $_ngcc_current_state = 6; aoqi@0: } aoqi@0: else { aoqi@0: unexpectedLeaveAttribute($__qname); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 2: aoqi@0: { aoqi@0: $_ngcc_current_state = 1; aoqi@0: $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); aoqi@0: } aoqi@0: break; aoqi@0: default: aoqi@0: { aoqi@0: unexpectedLeaveAttribute($__qname); aoqi@0: } aoqi@0: break; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: public void text(String $value) throws SAXException { aoqi@0: int $ai; aoqi@0: switch($_ngcc_current_state) { aoqi@0: case 4: aoqi@0: { aoqi@0: $_ngcc_current_state = 2; aoqi@0: $runtime.sendText(super._cookie, $value); aoqi@0: } aoqi@0: break; aoqi@0: case 9: aoqi@0: { aoqi@0: NGCCHandler h = new qname(this, super._source, $runtime, 187); aoqi@0: spawnChildFromText(h, $value); aoqi@0: } aoqi@0: break; aoqi@0: case 10: aoqi@0: { aoqi@0: __text = $value; aoqi@0: $_ngcc_current_state = 9; aoqi@0: action3(); aoqi@0: } aoqi@0: break; aoqi@0: case 0: aoqi@0: { aoqi@0: revertToParentFromText(result, super._cookie, $value); aoqi@0: } aoqi@0: break; aoqi@0: case 7: aoqi@0: { aoqi@0: if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) { aoqi@0: $runtime.consumeAttribute($ai); aoqi@0: $runtime.sendText(super._cookie, $value); aoqi@0: } aoqi@0: else { aoqi@0: $_ngcc_current_state = 6; aoqi@0: $runtime.sendText(super._cookie, $value); aoqi@0: } aoqi@0: } aoqi@0: break; aoqi@0: case 8: aoqi@0: { aoqi@0: NGCCHandler h = new qname(this, super._source, $runtime, 188); aoqi@0: spawnChildFromText(h, $value); aoqi@0: } aoqi@0: break; aoqi@0: case 2: aoqi@0: { aoqi@0: $_ngcc_current_state = 1; aoqi@0: $runtime.sendText(super._cookie, $value); aoqi@0: } aoqi@0: break; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException { aoqi@0: switch($__cookie__) { aoqi@0: case 183: aoqi@0: { aoqi@0: annotation = ((AnnotationImpl)$__result__); aoqi@0: $_ngcc_current_state = 2; aoqi@0: } aoqi@0: break; aoqi@0: case 187: aoqi@0: { aoqi@0: memberTypeName = ((UName)$__result__); aoqi@0: action2(); aoqi@0: $_ngcc_current_state = 8; aoqi@0: } aoqi@0: break; aoqi@0: case 179: aoqi@0: { aoqi@0: anonymousMemberType = ((SimpleTypeImpl)$__result__); aoqi@0: action1(); aoqi@0: $_ngcc_current_state = 1; aoqi@0: } aoqi@0: break; aoqi@0: case 188: aoqi@0: { aoqi@0: memberTypeName = ((UName)$__result__); aoqi@0: action2(); aoqi@0: $_ngcc_current_state = 8; aoqi@0: } aoqi@0: break; aoqi@0: case 185: aoqi@0: { aoqi@0: fa = ((ForeignAttributesImpl)$__result__); aoqi@0: $_ngcc_current_state = 4; aoqi@0: } aoqi@0: break; aoqi@0: case 180: aoqi@0: { aoqi@0: anonymousMemberType = ((SimpleTypeImpl)$__result__); aoqi@0: action1(); aoqi@0: $_ngcc_current_state = 1; aoqi@0: } aoqi@0: break; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: public boolean accepted() { aoqi@0: return(($_ngcc_current_state == 0)); aoqi@0: } aoqi@0: aoqi@0: aoqi@0: /** computed simple type object */ aoqi@0: private UnionSimpleTypeImpl result; aoqi@0: aoqi@0: // Vector of Ref.SimpleType aoqi@0: private final Vector members = new Vector(); aoqi@0: aoqi@0: // locator of aoqi@0: private Locator uloc; aoqi@0: aoqi@0: }