1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java Tue Mar 06 16:09:35 2012 -0800 1.3 @@ -0,0 +1,452 @@ 1.4 +/* 1.5 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +/* this file is generated by RelaxNGCC */ 1.30 +package com.sun.xml.internal.xsom.impl.parser.state; 1.31 +import org.xml.sax.SAXException; 1.32 +import org.xml.sax.XMLReader; 1.33 +import org.xml.sax.Attributes; 1.34 +import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx; 1.35 + 1.36 + import com.sun.xml.internal.xsom.*; 1.37 + import com.sun.xml.internal.xsom.parser.*; 1.38 + import com.sun.xml.internal.xsom.impl.*; 1.39 + import com.sun.xml.internal.xsom.impl.parser.*; 1.40 + import org.xml.sax.Locator; 1.41 + import org.xml.sax.ContentHandler; 1.42 + import org.xml.sax.helpers.*; 1.43 + import java.util.*; 1.44 + import java.math.BigInteger; 1.45 + 1.46 + 1.47 + 1.48 +class redefine extends NGCCHandler { 1.49 + private String schemaLocation; 1.50 + private ModelGroupDeclImpl newGrp; 1.51 + private AttGroupDeclImpl newAg; 1.52 + private SimpleTypeImpl newSt; 1.53 + private ComplexTypeImpl newCt; 1.54 + protected final NGCCRuntimeEx $runtime; 1.55 + private int $_ngcc_current_state; 1.56 + protected String $uri; 1.57 + protected String $localName; 1.58 + protected String $qname; 1.59 + 1.60 + public final NGCCRuntime getRuntime() { 1.61 + return($runtime); 1.62 + } 1.63 + 1.64 + public redefine(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) { 1.65 + super(source, parent, cookie); 1.66 + $runtime = runtime; 1.67 + $_ngcc_current_state = 15; 1.68 + } 1.69 + 1.70 + public redefine(NGCCRuntimeEx runtime) { 1.71 + this(null, runtime, runtime, -1); 1.72 + } 1.73 + 1.74 + private void action0()throws SAXException { 1.75 + XSAttGroupDecl oldAg = $runtime.currentSchema.getAttGroupDecl(newAg.getName()); 1.76 + if(oldAg==null) { 1.77 + $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_ATTRIBUTEGROUP,newAg.getName()) ); 1.78 + } else { 1.79 + newAg.redefine((AttGroupDeclImpl)oldAg); 1.80 + $runtime.currentSchema.addAttGroupDecl(newAg,true); 1.81 + } 1.82 +} 1.83 + 1.84 + private void action1()throws SAXException { 1.85 + XSModelGroupDecl oldGrp = $runtime.currentSchema.getModelGroupDecl(newGrp.getName()); 1.86 + if(oldGrp==null) { 1.87 + $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_MODELGROUP,newGrp.getName()) ); 1.88 + } else { 1.89 + newGrp.redefine((ModelGroupDeclImpl)oldGrp); 1.90 + $runtime.currentSchema.addModelGroupDecl(newGrp,true); 1.91 + } 1.92 +} 1.93 + 1.94 + private void action2()throws SAXException { 1.95 + XSComplexType oldCt = $runtime.currentSchema.getComplexType(newCt.getName()); 1.96 + if(oldCt==null) { 1.97 + $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_COMPLEXTYPE,newCt.getName()) ); 1.98 + } else { 1.99 + newCt.redefine((ComplexTypeImpl)oldCt); 1.100 + $runtime.currentSchema.addComplexType(newCt,true); 1.101 + } 1.102 +} 1.103 + 1.104 + private void action3()throws SAXException { 1.105 + XSSimpleType oldSt = $runtime.currentSchema.getSimpleType(newSt.getName()); 1.106 + if(oldSt==null) { 1.107 + $runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_SIMPLETYPE,newSt.getName()) ); 1.108 + } else { 1.109 + newSt.redefine((SimpleTypeImpl)oldSt); 1.110 + $runtime.currentSchema.addSimpleType(newSt,true); 1.111 + } 1.112 +} 1.113 + 1.114 + private void action4()throws SAXException { 1.115 + $runtime.includeSchema( schemaLocation ); 1.116 +} 1.117 + 1.118 + public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { 1.119 + int $ai; 1.120 + $uri = $__uri; 1.121 + $localName = $__local; 1.122 + $qname = $__qname; 1.123 + switch($_ngcc_current_state) { 1.124 + case 2: 1.125 + { 1.126 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { 1.127 + NGCCHandler h = new annotation(this, super._source, $runtime, 581, null,AnnotationContext.SCHEMA); 1.128 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.129 + } 1.130 + else { 1.131 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { 1.132 + NGCCHandler h = new simpleType(this, super._source, $runtime, 582); 1.133 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.134 + } 1.135 + else { 1.136 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) { 1.137 + NGCCHandler h = new complexType(this, super._source, $runtime, 583); 1.138 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.139 + } 1.140 + else { 1.141 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) { 1.142 + NGCCHandler h = new group(this, super._source, $runtime, 584); 1.143 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.144 + } 1.145 + else { 1.146 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) { 1.147 + NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 585); 1.148 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.149 + } 1.150 + else { 1.151 + $_ngcc_current_state = 1; 1.152 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.153 + } 1.154 + } 1.155 + } 1.156 + } 1.157 + } 1.158 + } 1.159 + break; 1.160 + case 15: 1.161 + { 1.162 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) { 1.163 + $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); 1.164 + $_ngcc_current_state = 14; 1.165 + } 1.166 + else { 1.167 + unexpectedEnterElement($__qname); 1.168 + } 1.169 + } 1.170 + break; 1.171 + case 0: 1.172 + { 1.173 + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); 1.174 + } 1.175 + break; 1.176 + case 14: 1.177 + { 1.178 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.179 + $runtime.consumeAttribute($ai); 1.180 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.181 + } 1.182 + else { 1.183 + unexpectedEnterElement($__qname); 1.184 + } 1.185 + } 1.186 + break; 1.187 + case 1: 1.188 + { 1.189 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { 1.190 + NGCCHandler h = new annotation(this, super._source, $runtime, 576, null,AnnotationContext.SCHEMA); 1.191 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.192 + } 1.193 + else { 1.194 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) { 1.195 + NGCCHandler h = new simpleType(this, super._source, $runtime, 577); 1.196 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.197 + } 1.198 + else { 1.199 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) { 1.200 + NGCCHandler h = new complexType(this, super._source, $runtime, 578); 1.201 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.202 + } 1.203 + else { 1.204 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) { 1.205 + NGCCHandler h = new group(this, super._source, $runtime, 579); 1.206 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.207 + } 1.208 + else { 1.209 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) { 1.210 + NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 580); 1.211 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.212 + } 1.213 + else { 1.214 + unexpectedEnterElement($__qname); 1.215 + } 1.216 + } 1.217 + } 1.218 + } 1.219 + } 1.220 + } 1.221 + break; 1.222 + default: 1.223 + { 1.224 + unexpectedEnterElement($__qname); 1.225 + } 1.226 + break; 1.227 + } 1.228 + } 1.229 + 1.230 + public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { 1.231 + int $ai; 1.232 + $uri = $__uri; 1.233 + $localName = $__local; 1.234 + $qname = $__qname; 1.235 + switch($_ngcc_current_state) { 1.236 + case 2: 1.237 + { 1.238 + $_ngcc_current_state = 1; 1.239 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.240 + } 1.241 + break; 1.242 + case 0: 1.243 + { 1.244 + revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); 1.245 + } 1.246 + break; 1.247 + case 14: 1.248 + { 1.249 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.250 + $runtime.consumeAttribute($ai); 1.251 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.252 + } 1.253 + else { 1.254 + unexpectedLeaveElement($__qname); 1.255 + } 1.256 + } 1.257 + break; 1.258 + case 1: 1.259 + { 1.260 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) { 1.261 + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); 1.262 + $_ngcc_current_state = 0; 1.263 + } 1.264 + else { 1.265 + unexpectedLeaveElement($__qname); 1.266 + } 1.267 + } 1.268 + break; 1.269 + default: 1.270 + { 1.271 + unexpectedLeaveElement($__qname); 1.272 + } 1.273 + break; 1.274 + } 1.275 + } 1.276 + 1.277 + public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { 1.278 + int $ai; 1.279 + $uri = $__uri; 1.280 + $localName = $__local; 1.281 + $qname = $__qname; 1.282 + switch($_ngcc_current_state) { 1.283 + case 2: 1.284 + { 1.285 + $_ngcc_current_state = 1; 1.286 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.287 + } 1.288 + break; 1.289 + case 0: 1.290 + { 1.291 + revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); 1.292 + } 1.293 + break; 1.294 + case 14: 1.295 + { 1.296 + if(($__uri.equals("") && $__local.equals("schemaLocation"))) { 1.297 + $_ngcc_current_state = 13; 1.298 + } 1.299 + else { 1.300 + unexpectedEnterAttribute($__qname); 1.301 + } 1.302 + } 1.303 + break; 1.304 + default: 1.305 + { 1.306 + unexpectedEnterAttribute($__qname); 1.307 + } 1.308 + break; 1.309 + } 1.310 + } 1.311 + 1.312 + public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { 1.313 + int $ai; 1.314 + $uri = $__uri; 1.315 + $localName = $__local; 1.316 + $qname = $__qname; 1.317 + switch($_ngcc_current_state) { 1.318 + case 2: 1.319 + { 1.320 + $_ngcc_current_state = 1; 1.321 + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 1.322 + } 1.323 + break; 1.324 + case 12: 1.325 + { 1.326 + if(($__uri.equals("") && $__local.equals("schemaLocation"))) { 1.327 + $_ngcc_current_state = 2; 1.328 + } 1.329 + else { 1.330 + unexpectedLeaveAttribute($__qname); 1.331 + } 1.332 + } 1.333 + break; 1.334 + case 0: 1.335 + { 1.336 + revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); 1.337 + } 1.338 + break; 1.339 + default: 1.340 + { 1.341 + unexpectedLeaveAttribute($__qname); 1.342 + } 1.343 + break; 1.344 + } 1.345 + } 1.346 + 1.347 + public void text(String $value) throws SAXException { 1.348 + int $ai; 1.349 + switch($_ngcc_current_state) { 1.350 + case 2: 1.351 + { 1.352 + $_ngcc_current_state = 1; 1.353 + $runtime.sendText(super._cookie, $value); 1.354 + } 1.355 + break; 1.356 + case 13: 1.357 + { 1.358 + schemaLocation = $value; 1.359 + $_ngcc_current_state = 12; 1.360 + action4(); 1.361 + } 1.362 + break; 1.363 + case 0: 1.364 + { 1.365 + revertToParentFromText(this, super._cookie, $value); 1.366 + } 1.367 + break; 1.368 + case 14: 1.369 + { 1.370 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.371 + $runtime.consumeAttribute($ai); 1.372 + $runtime.sendText(super._cookie, $value); 1.373 + } 1.374 + } 1.375 + break; 1.376 + } 1.377 + } 1.378 + 1.379 + public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException { 1.380 + switch($__cookie__) { 1.381 + case 581: 1.382 + { 1.383 + $_ngcc_current_state = 1; 1.384 + } 1.385 + break; 1.386 + case 582: 1.387 + { 1.388 + newSt = ((SimpleTypeImpl)$__result__); 1.389 + action3(); 1.390 + $_ngcc_current_state = 1; 1.391 + } 1.392 + break; 1.393 + case 583: 1.394 + { 1.395 + newCt = ((ComplexTypeImpl)$__result__); 1.396 + action2(); 1.397 + $_ngcc_current_state = 1; 1.398 + } 1.399 + break; 1.400 + case 584: 1.401 + { 1.402 + newGrp = ((ModelGroupDeclImpl)$__result__); 1.403 + action1(); 1.404 + $_ngcc_current_state = 1; 1.405 + } 1.406 + break; 1.407 + case 585: 1.408 + { 1.409 + newAg = ((AttGroupDeclImpl)$__result__); 1.410 + action0(); 1.411 + $_ngcc_current_state = 1; 1.412 + } 1.413 + break; 1.414 + case 576: 1.415 + { 1.416 + $_ngcc_current_state = 1; 1.417 + } 1.418 + break; 1.419 + case 577: 1.420 + { 1.421 + newSt = ((SimpleTypeImpl)$__result__); 1.422 + action3(); 1.423 + $_ngcc_current_state = 1; 1.424 + } 1.425 + break; 1.426 + case 578: 1.427 + { 1.428 + newCt = ((ComplexTypeImpl)$__result__); 1.429 + action2(); 1.430 + $_ngcc_current_state = 1; 1.431 + } 1.432 + break; 1.433 + case 579: 1.434 + { 1.435 + newGrp = ((ModelGroupDeclImpl)$__result__); 1.436 + action1(); 1.437 + $_ngcc_current_state = 1; 1.438 + } 1.439 + break; 1.440 + case 580: 1.441 + { 1.442 + newAg = ((AttGroupDeclImpl)$__result__); 1.443 + action0(); 1.444 + $_ngcc_current_state = 1; 1.445 + } 1.446 + break; 1.447 + } 1.448 + } 1.449 + 1.450 + public boolean accepted() { 1.451 + return(($_ngcc_current_state == 0)); 1.452 + } 1.453 + 1.454 + 1.455 +}