ohair@286: /* alanb@368: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. ohair@286: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ohair@286: * ohair@286: * This code is free software; you can redistribute it and/or modify it ohair@286: * under the terms of the GNU General Public License version 2 only, as ohair@286: * published by the Free Software Foundation. Oracle designates this ohair@286: * particular file as subject to the "Classpath" exception as provided ohair@286: * by Oracle in the LICENSE file that accompanied this code. ohair@286: * ohair@286: * This code is distributed in the hope that it will be useful, but WITHOUT ohair@286: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ohair@286: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ohair@286: * version 2 for more details (a copy is included in the LICENSE file that ohair@286: * accompanied this code). ohair@286: * ohair@286: * You should have received a copy of the GNU General Public License version ohair@286: * 2 along with this work; if not, write to the Free Software Foundation, ohair@286: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ohair@286: * ohair@286: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@286: * or visit www.oracle.com if you need additional information or have any ohair@286: * questions. ohair@286: */ ohair@286: ohair@286: /* this file is generated by RelaxNGCC */ ohair@286: package com.sun.tools.internal.jxc.gen.config; ohair@286: import org.xml.sax.SAXException; ohair@286: import org.xml.sax.XMLReader; ohair@286: import org.xml.sax.Attributes; ohair@286: import com.sun.tools.internal.jxc.NGCCRuntimeEx; ohair@286: import javax.xml.parsers.SAXParserFactory; ohair@286: import org.xml.sax.XMLReader; ohair@286: ohair@286: import java.util.List; ohair@286: import java.util.ArrayList; ohair@286: import java.io.File; ohair@286: mkos@397: /** mkos@397: *

mkos@397: * Auto-generated, do not edit. mkos@397: *

mkos@397: */ ohair@286: public class Config extends NGCCHandler { ohair@286: private String bd; ohair@286: private Schema _schema; ohair@286: protected final NGCCRuntimeEx $runtime; ohair@286: private int $_ngcc_current_state; ohair@286: protected String $uri; ohair@286: protected String $localName; ohair@286: protected String $qname; ohair@286: ohair@286: public final NGCCRuntime getRuntime() { ohair@286: return($runtime); ohair@286: } ohair@286: ohair@286: public Config(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) { ohair@286: super(source, parent, cookie); ohair@286: $runtime = runtime; ohair@286: $_ngcc_current_state = 8; ohair@286: } ohair@286: ohair@286: public Config(NGCCRuntimeEx runtime) { ohair@286: this(null, runtime, runtime, -1); ohair@286: } ohair@286: ohair@286: private void action0()throws SAXException { ohair@286: this.schema.add (_schema); ohair@286: } ohair@286: ohair@286: private void action1()throws SAXException { ohair@286: baseDir = $runtime.getBaseDir(bd); ohair@286: } ohair@286: ohair@286: public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { ohair@286: int $ai; ohair@286: $uri = $__uri; ohair@286: $localName = $__local; ohair@286: $qname = $__qname; ohair@286: switch($_ngcc_current_state) { mkos@397: case 0: mkos@397: { mkos@397: revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); mkos@397: } mkos@397: break; mkos@397: case 1: alanb@368: { alanb@368: if(($__uri.equals("") && $__local.equals("schema"))) { mkos@397: NGCCHandler h = new Schema(this, super._source, $runtime, 19, baseDir); alanb@368: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); alanb@368: } alanb@368: else { mkos@397: unexpectedEnterElement($__qname); ohair@286: } ohair@286: } ohair@286: break; alanb@368: case 8: ohair@286: { alanb@368: if(($__uri.equals("") && $__local.equals("config"))) { alanb@368: $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); alanb@368: $_ngcc_current_state = 7; ohair@286: } ohair@286: else { ohair@286: unexpectedEnterElement($__qname); ohair@286: } ohair@286: } ohair@286: break; mkos@384: case 4: ohair@286: { mkos@384: if(($__uri.equals("") && $__local.equals("classes"))) { mkos@397: NGCCHandler h = new Classes(this, super._source, $runtime, 22); ohair@286: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); ohair@286: } ohair@286: else { mkos@384: unexpectedEnterElement($__qname); ohair@286: } ohair@286: } ohair@286: break; mkos@397: case 2: mkos@384: { mkos@384: if(($__uri.equals("") && $__local.equals("schema"))) { mkos@397: NGCCHandler h = new Schema(this, super._source, $runtime, 20, baseDir); ohair@286: spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); ohair@286: } ohair@286: else { mkos@397: $_ngcc_current_state = 1; mkos@397: $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); ohair@286: } ohair@286: } ohair@286: break; mkos@384: case 7: mkos@384: { mkos@384: if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { mkos@384: $runtime.consumeAttribute($ai); mkos@384: $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); mkos@384: } mkos@384: else { mkos@384: unexpectedEnterElement($__qname); mkos@384: } mkos@384: } mkos@384: break; ohair@286: default: ohair@286: { ohair@286: unexpectedEnterElement($__qname); ohair@286: } ohair@286: break; ohair@286: } ohair@286: } ohair@286: ohair@286: public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { ohair@286: int $ai; ohair@286: $uri = $__uri; ohair@286: $localName = $__local; ohair@286: $qname = $__qname; ohair@286: switch($_ngcc_current_state) { mkos@384: case 0: mkos@384: { mkos@384: revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); mkos@384: } mkos@384: break; alanb@368: case 1: ohair@286: { alanb@368: if(($__uri.equals("") && $__local.equals("config"))) { alanb@368: $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); alanb@368: $_ngcc_current_state = 0; ohair@286: } ohair@286: else { ohair@286: unexpectedLeaveElement($__qname); ohair@286: } ohair@286: } ohair@286: break; mkos@397: case 2: mkos@397: { mkos@397: $_ngcc_current_state = 1; mkos@397: $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); mkos@397: } mkos@397: break; alanb@368: case 7: ohair@286: { alanb@368: if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { alanb@368: $runtime.consumeAttribute($ai); alanb@368: $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); ohair@286: } ohair@286: else { ohair@286: unexpectedLeaveElement($__qname); ohair@286: } ohair@286: } ohair@286: break; ohair@286: default: ohair@286: { ohair@286: unexpectedLeaveElement($__qname); ohair@286: } ohair@286: break; ohair@286: } ohair@286: } ohair@286: ohair@286: public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { ohair@286: int $ai; ohair@286: $uri = $__uri; ohair@286: $localName = $__local; ohair@286: $qname = $__qname; ohair@286: switch($_ngcc_current_state) { mkos@397: case 0: mkos@397: { mkos@397: revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); mkos@397: } mkos@397: break; mkos@384: case 2: mkos@384: { mkos@384: $_ngcc_current_state = 1; mkos@384: $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); mkos@384: } mkos@384: break; ohair@286: case 7: ohair@286: { ohair@286: if(($__uri.equals("") && $__local.equals("baseDir"))) { ohair@286: $_ngcc_current_state = 6; ohair@286: } ohair@286: else { ohair@286: unexpectedEnterAttribute($__qname); ohair@286: } ohair@286: } ohair@286: break; ohair@286: default: ohair@286: { ohair@286: unexpectedEnterAttribute($__qname); ohair@286: } ohair@286: break; ohair@286: } ohair@286: } ohair@286: ohair@286: public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { ohair@286: int $ai; ohair@286: $uri = $__uri; ohair@286: $localName = $__local; ohair@286: $qname = $__qname; ohair@286: switch($_ngcc_current_state) { mkos@397: case 0: alanb@368: { mkos@397: revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); alanb@368: } alanb@368: break; ohair@286: case 5: ohair@286: { ohair@286: if(($__uri.equals("") && $__local.equals("baseDir"))) { ohair@286: $_ngcc_current_state = 4; ohair@286: } ohair@286: else { ohair@286: unexpectedLeaveAttribute($__qname); ohair@286: } ohair@286: } ohair@286: break; mkos@397: case 2: mkos@384: { mkos@397: $_ngcc_current_state = 1; mkos@397: $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); mkos@384: } mkos@384: break; ohair@286: default: ohair@286: { ohair@286: unexpectedLeaveAttribute($__qname); ohair@286: } ohair@286: break; ohair@286: } ohair@286: } ohair@286: ohair@286: public void text(String $value) throws SAXException { ohair@286: int $ai; ohair@286: switch($_ngcc_current_state) { mkos@397: case 0: alanb@368: { mkos@397: revertToParentFromText(this, super._cookie, $value); alanb@368: } alanb@368: break; alanb@368: case 6: alanb@368: { alanb@368: bd = $value; alanb@368: $_ngcc_current_state = 5; alanb@368: action1(); alanb@368: } alanb@368: break; mkos@397: case 2: mkos@384: { mkos@397: $_ngcc_current_state = 1; mkos@397: $runtime.sendText(super._cookie, $value); mkos@384: } mkos@384: break; ohair@286: case 7: ohair@286: { ohair@286: if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { ohair@286: $runtime.consumeAttribute($ai); ohair@286: $runtime.sendText(super._cookie, $value); ohair@286: } ohair@286: } ohair@286: break; ohair@286: } ohair@286: } ohair@286: ohair@286: public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException { ohair@286: switch(cookie) { mkos@397: case 19: ohair@286: { ohair@286: this._schema = ((Schema)result); ohair@286: action0(); ohair@286: $_ngcc_current_state = 1; ohair@286: } ohair@286: break; mkos@397: case 22: alanb@368: { alanb@368: this.classes = ((Classes)result); alanb@368: $_ngcc_current_state = 2; alanb@368: } alanb@368: break; mkos@397: case 20: ohair@286: { ohair@286: this._schema = ((Schema)result); ohair@286: action0(); ohair@286: $_ngcc_current_state = 1; ohair@286: } ohair@286: break; ohair@286: } ohair@286: } ohair@286: ohair@286: public boolean accepted() { ohair@286: return(($_ngcc_current_state == 0)); ohair@286: } ohair@286: ohair@286: ohair@286: private File baseDir; ohair@286: private Classes classes; ohair@286: private List schema = new ArrayList(); ohair@286: public Classes getClasses() { return this.classes;} ohair@286: public File getBaseDir() { return baseDir;} ohair@286: public List getSchema() { return this.schema;} ohair@286: ohair@286: }