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 Tue Mar 06 16:09:35 2012 -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 0: 1.85 + { 1.86 + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); 1.87 + } 1.88 + break; 1.89 + case 8: 1.90 + { 1.91 + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { 1.92 + $runtime.consumeAttribute($ai); 1.93 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.94 + } 1.95 + else { 1.96 + $_ngcc_current_state = 4; 1.97 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.98 + } 1.99 + } 1.100 + break; 1.101 + case 12: 1.102 + { 1.103 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) { 1.104 + $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); 1.105 + $_ngcc_current_state = 8; 1.106 + } 1.107 + else { 1.108 + unexpectedEnterElement($__qname); 1.109 + } 1.110 + } 1.111 + break; 1.112 + case 2: 1.113 + { 1.114 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) { 1.115 + NGCCHandler h = new annotation(this, super._source, $runtime, 498, null,AnnotationContext.SCHEMA); 1.116 + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); 1.117 + } 1.118 + else { 1.119 + $_ngcc_current_state = 1; 1.120 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.121 + } 1.122 + } 1.123 + break; 1.124 + case 4: 1.125 + { 1.126 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.127 + $runtime.consumeAttribute($ai); 1.128 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.129 + } 1.130 + else { 1.131 + $_ngcc_current_state = 2; 1.132 + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 1.133 + } 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 0: 1.151 + { 1.152 + revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); 1.153 + } 1.154 + break; 1.155 + case 8: 1.156 + { 1.157 + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { 1.158 + $runtime.consumeAttribute($ai); 1.159 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.160 + } 1.161 + else { 1.162 + $_ngcc_current_state = 4; 1.163 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.164 + } 1.165 + } 1.166 + break; 1.167 + case 1: 1.168 + { 1.169 + if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) { 1.170 + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); 1.171 + $_ngcc_current_state = 0; 1.172 + action0(); 1.173 + } 1.174 + else { 1.175 + unexpectedLeaveElement($__qname); 1.176 + } 1.177 + } 1.178 + break; 1.179 + case 2: 1.180 + { 1.181 + $_ngcc_current_state = 1; 1.182 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.183 + } 1.184 + break; 1.185 + case 4: 1.186 + { 1.187 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.188 + $runtime.consumeAttribute($ai); 1.189 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.190 + } 1.191 + else { 1.192 + $_ngcc_current_state = 2; 1.193 + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 1.194 + } 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 0: 1.212 + { 1.213 + revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); 1.214 + } 1.215 + break; 1.216 + case 8: 1.217 + { 1.218 + if(($__uri.equals("") && $__local.equals("namespace"))) { 1.219 + $_ngcc_current_state = 10; 1.220 + } 1.221 + else { 1.222 + $_ngcc_current_state = 4; 1.223 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.224 + } 1.225 + } 1.226 + break; 1.227 + case 2: 1.228 + { 1.229 + $_ngcc_current_state = 1; 1.230 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.231 + } 1.232 + break; 1.233 + case 4: 1.234 + { 1.235 + if(($__uri.equals("") && $__local.equals("schemaLocation"))) { 1.236 + $_ngcc_current_state = 6; 1.237 + } 1.238 + else { 1.239 + $_ngcc_current_state = 2; 1.240 + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 1.241 + } 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 0: 1.269 + { 1.270 + revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); 1.271 + } 1.272 + break; 1.273 + case 8: 1.274 + { 1.275 + $_ngcc_current_state = 4; 1.276 + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 1.277 + } 1.278 + break; 1.279 + case 2: 1.280 + { 1.281 + $_ngcc_current_state = 1; 1.282 + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 1.283 + } 1.284 + break; 1.285 + case 5: 1.286 + { 1.287 + if(($__uri.equals("") && $__local.equals("schemaLocation"))) { 1.288 + $_ngcc_current_state = 2; 1.289 + } 1.290 + else { 1.291 + unexpectedLeaveAttribute($__qname); 1.292 + } 1.293 + } 1.294 + break; 1.295 + case 4: 1.296 + { 1.297 + $_ngcc_current_state = 2; 1.298 + $runtime.sendLeaveAttribute(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 0: 1.313 + { 1.314 + revertToParentFromText(this, super._cookie, $value); 1.315 + } 1.316 + break; 1.317 + case 8: 1.318 + { 1.319 + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { 1.320 + $runtime.consumeAttribute($ai); 1.321 + $runtime.sendText(super._cookie, $value); 1.322 + } 1.323 + else { 1.324 + $_ngcc_current_state = 4; 1.325 + $runtime.sendText(super._cookie, $value); 1.326 + } 1.327 + } 1.328 + break; 1.329 + case 6: 1.330 + { 1.331 + schemaLocation = $value; 1.332 + $_ngcc_current_state = 5; 1.333 + } 1.334 + break; 1.335 + case 2: 1.336 + { 1.337 + $_ngcc_current_state = 1; 1.338 + $runtime.sendText(super._cookie, $value); 1.339 + } 1.340 + break; 1.341 + case 4: 1.342 + { 1.343 + if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { 1.344 + $runtime.consumeAttribute($ai); 1.345 + $runtime.sendText(super._cookie, $value); 1.346 + } 1.347 + else { 1.348 + $_ngcc_current_state = 2; 1.349 + $runtime.sendText(super._cookie, $value); 1.350 + } 1.351 + } 1.352 + break; 1.353 + case 10: 1.354 + { 1.355 + ns = $value; 1.356 + $_ngcc_current_state = 9; 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 498: 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 +}