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/importDecl.java Wed Apr 27 01:27:09 2016 +0800 1.3 @@ -0,0 +1,374 @@ 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 importDecl extends NGCCHandler { 1.49 + private String ns; 1.50 + private String schemaLocation; 1.51 + protected final NGCCRuntimeEx $runtime; 1.52 + private int $_ngcc_current_state; 1.53 + protected String $uri; 1.54 + protected String $localName; 1.55 + protected String $qname; 1.56 + 1.57 + public final NGCCRuntime getRuntime() { 1.58 + return($runtime); 1.59 + } 1.60 + 1.61 + public importDecl(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) { 1.62 + super(source, parent, cookie); 1.63 + $runtime = runtime; 1.64 + $_ngcc_current_state = 12; 1.65 + } 1.66 + 1.67 + public importDecl(NGCCRuntimeEx runtime) { 1.68 + this(null, runtime, runtime, -1); 1.69 + } 1.70 + 1.71 + private void action0()throws SAXException { 1.72 + 1.73 + if(ns==null) ns=""; 1.74 + $runtime.importSchema( ns,schemaLocation ); 1.75 + 1.76 +} 1.77 + 1.78 + public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { 1.79 + int $ai; 1.80 + $uri = $__uri; 1.81 + $localName = $__local; 1.82 + $qname = $__qname; 1.83 + switch($_ngcc_current_state) { 1.84 + case 4: 1.85 + { 1.86 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.87 + $runtime.consumeAttribute($ai); 1.88 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.89 + } 1.90 + else { 1.91 + $_ngcc_current_state = 2; 1.92 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.93 + } 1.94 + } 1.95 + break; 1.96 + case 8: 1.97 + { 1.98 + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { 1.99 + $runtime.consumeAttribute($ai); 1.100 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.101 + } 1.102 + else { 1.103 + $_ngcc_current_state = 4; 1.104 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.105 + } 1.106 + } 1.107 + break; 1.108 + case 12: 1.109 + { 1.110 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) { 1.111 + $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); 1.112 + $_ngcc_current_state = 8; 1.113 + } 1.114 + else { 1.115 + unexpectedEnterElement($__qname); 1.116 + } 1.117 + } 1.118 + break; 1.119 + case 2: 1.120 + { 1.121 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { 1.122 + NGCCHandler h = new annotation(this, super._source, $runtime, 340, null,AnnotationContext.SCHEMA); 1.123 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.124 + } 1.125 + else { 1.126 + $_ngcc_current_state = 1; 1.127 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.128 + } 1.129 + } 1.130 + break; 1.131 + case 0: 1.132 + { 1.133 + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); 1.134 + } 1.135 + break; 1.136 + default: 1.137 + { 1.138 + unexpectedEnterElement($__qname); 1.139 + } 1.140 + break; 1.141 + } 1.142 + } 1.143 + 1.144 + public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { 1.145 + int $ai; 1.146 + $uri = $__uri; 1.147 + $localName = $__local; 1.148 + $qname = $__qname; 1.149 + switch($_ngcc_current_state) { 1.150 + case 4: 1.151 + { 1.152 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.153 + $runtime.consumeAttribute($ai); 1.154 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.155 + } 1.156 + else { 1.157 + $_ngcc_current_state = 2; 1.158 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.159 + } 1.160 + } 1.161 + break; 1.162 + case 8: 1.163 + { 1.164 + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { 1.165 + $runtime.consumeAttribute($ai); 1.166 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.167 + } 1.168 + else { 1.169 + $_ngcc_current_state = 4; 1.170 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.171 + } 1.172 + } 1.173 + break; 1.174 + case 2: 1.175 + { 1.176 + $_ngcc_current_state = 1; 1.177 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.178 + } 1.179 + break; 1.180 + case 1: 1.181 + { 1.182 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) { 1.183 + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); 1.184 + $_ngcc_current_state = 0; 1.185 + action0(); 1.186 + } 1.187 + else { 1.188 + unexpectedLeaveElement($__qname); 1.189 + } 1.190 + } 1.191 + break; 1.192 + case 0: 1.193 + { 1.194 + revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); 1.195 + } 1.196 + break; 1.197 + default: 1.198 + { 1.199 + unexpectedLeaveElement($__qname); 1.200 + } 1.201 + break; 1.202 + } 1.203 + } 1.204 + 1.205 + public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { 1.206 + int $ai; 1.207 + $uri = $__uri; 1.208 + $localName = $__local; 1.209 + $qname = $__qname; 1.210 + switch($_ngcc_current_state) { 1.211 + case 4: 1.212 + { 1.213 + if(($__uri.equals("") && $__local.equals("schemaLocation"))) { 1.214 + $_ngcc_current_state = 6; 1.215 + } 1.216 + else { 1.217 + $_ngcc_current_state = 2; 1.218 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.219 + } 1.220 + } 1.221 + break; 1.222 + case 8: 1.223 + { 1.224 + if(($__uri.equals("") && $__local.equals("namespace"))) { 1.225 + $_ngcc_current_state = 10; 1.226 + } 1.227 + else { 1.228 + $_ngcc_current_state = 4; 1.229 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.230 + } 1.231 + } 1.232 + break; 1.233 + case 2: 1.234 + { 1.235 + $_ngcc_current_state = 1; 1.236 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.237 + } 1.238 + break; 1.239 + case 0: 1.240 + { 1.241 + revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); 1.242 + } 1.243 + break; 1.244 + default: 1.245 + { 1.246 + unexpectedEnterAttribute($__qname); 1.247 + } 1.248 + break; 1.249 + } 1.250 + } 1.251 + 1.252 + public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { 1.253 + int $ai; 1.254 + $uri = $__uri; 1.255 + $localName = $__local; 1.256 + $qname = $__qname; 1.257 + switch($_ngcc_current_state) { 1.258 + case 9: 1.259 + { 1.260 + if(($__uri.equals("") && $__local.equals("namespace"))) { 1.261 + $_ngcc_current_state = 4; 1.262 + } 1.263 + else { 1.264 + unexpectedLeaveAttribute($__qname); 1.265 + } 1.266 + } 1.267 + break; 1.268 + case 4: 1.269 + { 1.270 + $_ngcc_current_state = 2; 1.271 + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 1.272 + } 1.273 + break; 1.274 + case 8: 1.275 + { 1.276 + $_ngcc_current_state = 4; 1.277 + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 1.278 + } 1.279 + break; 1.280 + case 5: 1.281 + { 1.282 + if(($__uri.equals("") && $__local.equals("schemaLocation"))) { 1.283 + $_ngcc_current_state = 2; 1.284 + } 1.285 + else { 1.286 + unexpectedLeaveAttribute($__qname); 1.287 + } 1.288 + } 1.289 + break; 1.290 + case 2: 1.291 + { 1.292 + $_ngcc_current_state = 1; 1.293 + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 1.294 + } 1.295 + break; 1.296 + case 0: 1.297 + { 1.298 + revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); 1.299 + } 1.300 + break; 1.301 + default: 1.302 + { 1.303 + unexpectedLeaveAttribute($__qname); 1.304 + } 1.305 + break; 1.306 + } 1.307 + } 1.308 + 1.309 + public void text(String $value) throws SAXException { 1.310 + int $ai; 1.311 + switch($_ngcc_current_state) { 1.312 + case 4: 1.313 + { 1.314 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.315 + $runtime.consumeAttribute($ai); 1.316 + $runtime.sendText(super._cookie, $value); 1.317 + } 1.318 + else { 1.319 + $_ngcc_current_state = 2; 1.320 + $runtime.sendText(super._cookie, $value); 1.321 + } 1.322 + } 1.323 + break; 1.324 + case 8: 1.325 + { 1.326 + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { 1.327 + $runtime.consumeAttribute($ai); 1.328 + $runtime.sendText(super._cookie, $value); 1.329 + } 1.330 + else { 1.331 + $_ngcc_current_state = 4; 1.332 + $runtime.sendText(super._cookie, $value); 1.333 + } 1.334 + } 1.335 + break; 1.336 + case 10: 1.337 + { 1.338 + ns = $value; 1.339 + $_ngcc_current_state = 9; 1.340 + } 1.341 + break; 1.342 + case 2: 1.343 + { 1.344 + $_ngcc_current_state = 1; 1.345 + $runtime.sendText(super._cookie, $value); 1.346 + } 1.347 + break; 1.348 + case 0: 1.349 + { 1.350 + revertToParentFromText(this, super._cookie, $value); 1.351 + } 1.352 + break; 1.353 + case 6: 1.354 + { 1.355 + schemaLocation = $value; 1.356 + $_ngcc_current_state = 5; 1.357 + } 1.358 + break; 1.359 + } 1.360 + } 1.361 + 1.362 + public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException { 1.363 + switch($__cookie__) { 1.364 + case 340: 1.365 + { 1.366 + $_ngcc_current_state = 1; 1.367 + } 1.368 + break; 1.369 + } 1.370 + } 1.371 + 1.372 + public boolean accepted() { 1.373 + return(($_ngcc_current_state == 0)); 1.374 + } 1.375 + 1.376 + 1.377 +}