src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java

Fri, 23 Aug 2013 09:57:21 +0100

author
mkos
date
Fri, 23 Aug 2013 09:57:21 +0100
changeset 397
b99d7e355d4b
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
permissions
-rw-r--r--

8022885: Update JAX-WS RI integration to 2.2.9-b14140
8013016: Rebase 8009009 against the latest jdk8/jaxws
Reviewed-by: alanb, chegar

ohair@286 1 /*
ohair@286 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 /* this file is generated by RelaxNGCC */
ohair@286 27 package com.sun.xml.internal.xsom.impl.parser.state;
ohair@286 28 import org.xml.sax.SAXException;
ohair@286 29 import org.xml.sax.XMLReader;
ohair@286 30 import org.xml.sax.Attributes;
ohair@286 31 import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
ohair@286 32
ohair@286 33 import com.sun.xml.internal.xsom.*;
ohair@286 34 import com.sun.xml.internal.xsom.parser.*;
ohair@286 35 import com.sun.xml.internal.xsom.impl.*;
ohair@286 36 import com.sun.xml.internal.xsom.impl.parser.*;
ohair@286 37 import org.xml.sax.Locator;
ohair@286 38 import org.xml.sax.ContentHandler;
ohair@286 39 import org.xml.sax.helpers.*;
ohair@286 40 import java.util.*;
ohair@286 41 import java.math.BigInteger;
ohair@286 42
ohair@286 43 import java.util.StringTokenizer;
ohair@286 44 import java.util.HashSet;
ohair@286 45
ohair@286 46
ohair@286 47 class wildcardBody extends NGCCHandler {
ohair@286 48 private AnnotationImpl annotation;
ohair@286 49 private Locator locator;
ohair@286 50 private String modeValue;
ohair@286 51 private String ns;
ohair@286 52 private ForeignAttributesImpl fa;
ohair@286 53 protected final NGCCRuntimeEx $runtime;
ohair@286 54 private int $_ngcc_current_state;
ohair@286 55 protected String $uri;
ohair@286 56 protected String $localName;
ohair@286 57 protected String $qname;
ohair@286 58
ohair@286 59 public final NGCCRuntime getRuntime() {
ohair@286 60 return($runtime);
ohair@286 61 }
ohair@286 62
ohair@286 63 public wildcardBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator) {
ohair@286 64 super(source, parent, cookie);
ohair@286 65 $runtime = runtime;
ohair@286 66 this.locator = _locator;
ohair@286 67 $_ngcc_current_state = 10;
ohair@286 68 }
ohair@286 69
ohair@286 70 public wildcardBody(NGCCRuntimeEx runtime, Locator _locator) {
ohair@286 71 this(null, runtime, runtime, -1, _locator);
ohair@286 72 }
ohair@286 73
ohair@286 74 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
ohair@286 75 int $ai;
ohair@286 76 $uri = $__uri;
ohair@286 77 $localName = $__local;
ohair@286 78 $qname = $__qname;
ohair@286 79 switch($_ngcc_current_state) {
mkos@397 80 case 1:
mkos@397 81 {
mkos@397 82 if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
mkos@397 83 $runtime.consumeAttribute($ai);
mkos@397 84 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 85 }
mkos@397 86 else {
mkos@397 87 $_ngcc_current_state = 0;
mkos@397 88 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 89 }
mkos@397 90 }
mkos@397 91 break;
ohair@286 92 case 5:
ohair@286 93 {
ohair@286 94 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
ohair@286 95 $runtime.consumeAttribute($ai);
ohair@286 96 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 97 }
ohair@286 98 else {
ohair@286 99 $_ngcc_current_state = 1;
ohair@286 100 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 101 }
ohair@286 102 }
ohair@286 103 break;
ohair@286 104 case 9:
ohair@286 105 {
mkos@397 106 if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
mkos@397 107 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 108 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 109 }
ohair@286 110 else {
mkos@397 111 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 112 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 113 }
ohair@286 114 }
ohair@286 115 break;
ohair@286 116 case 10:
ohair@286 117 {
ohair@286 118 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
mkos@397 119 NGCCHandler h = new annotation(this, super._source, $runtime, 411, null,AnnotationContext.WILDCARD);
ohair@286 120 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 121 }
ohair@286 122 else {
ohair@286 123 $_ngcc_current_state = 9;
ohair@286 124 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 125 }
ohair@286 126 }
ohair@286 127 break;
ohair@286 128 case 0:
ohair@286 129 {
ohair@286 130 revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 131 }
ohair@286 132 break;
ohair@286 133 default:
ohair@286 134 {
ohair@286 135 unexpectedEnterElement($__qname);
ohair@286 136 }
ohair@286 137 break;
ohair@286 138 }
ohair@286 139 }
ohair@286 140
ohair@286 141 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 142 int $ai;
ohair@286 143 $uri = $__uri;
ohair@286 144 $localName = $__local;
ohair@286 145 $qname = $__qname;
ohair@286 146 switch($_ngcc_current_state) {
mkos@397 147 case 1:
mkos@397 148 {
mkos@397 149 if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
mkos@397 150 $runtime.consumeAttribute($ai);
mkos@397 151 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
mkos@397 152 }
mkos@397 153 else {
mkos@397 154 $_ngcc_current_state = 0;
mkos@397 155 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
mkos@397 156 }
mkos@397 157 }
mkos@397 158 break;
ohair@286 159 case 5:
ohair@286 160 {
ohair@286 161 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
ohair@286 162 $runtime.consumeAttribute($ai);
ohair@286 163 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 164 }
ohair@286 165 else {
ohair@286 166 $_ngcc_current_state = 1;
ohair@286 167 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 168 }
ohair@286 169 }
ohair@286 170 break;
ohair@286 171 case 9:
ohair@286 172 {
mkos@397 173 if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
mkos@397 174 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 175 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
ohair@286 176 }
ohair@286 177 else {
mkos@397 178 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 179 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
ohair@286 180 }
ohair@286 181 }
ohair@286 182 break;
ohair@286 183 case 10:
ohair@286 184 {
ohair@286 185 $_ngcc_current_state = 9;
ohair@286 186 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 187 }
ohair@286 188 break;
ohair@286 189 case 0:
ohair@286 190 {
ohair@286 191 revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
ohair@286 192 }
ohair@286 193 break;
ohair@286 194 default:
ohair@286 195 {
ohair@286 196 unexpectedLeaveElement($__qname);
ohair@286 197 }
ohair@286 198 break;
ohair@286 199 }
ohair@286 200 }
ohair@286 201
ohair@286 202 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 203 int $ai;
ohair@286 204 $uri = $__uri;
ohair@286 205 $localName = $__local;
ohair@286 206 $qname = $__qname;
ohair@286 207 switch($_ngcc_current_state) {
mkos@397 208 case 1:
mkos@397 209 {
mkos@397 210 if(($__uri.equals("") && $__local.equals("namespace"))) {
mkos@397 211 $_ngcc_current_state = 3;
mkos@397 212 }
mkos@397 213 else {
mkos@397 214 $_ngcc_current_state = 0;
mkos@397 215 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 216 }
mkos@397 217 }
mkos@397 218 break;
ohair@286 219 case 5:
ohair@286 220 {
ohair@286 221 if(($__uri.equals("") && $__local.equals("processContents"))) {
ohair@286 222 $_ngcc_current_state = 7;
ohair@286 223 }
ohair@286 224 else {
ohair@286 225 $_ngcc_current_state = 1;
ohair@286 226 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 227 }
ohair@286 228 }
ohair@286 229 break;
ohair@286 230 case 9:
ohair@286 231 {
mkos@397 232 if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
mkos@397 233 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 234 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
ohair@286 235 }
ohair@286 236 else {
mkos@397 237 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 238 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
ohair@286 239 }
ohair@286 240 }
ohair@286 241 break;
ohair@286 242 case 10:
ohair@286 243 {
ohair@286 244 $_ngcc_current_state = 9;
ohair@286 245 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 246 }
ohair@286 247 break;
ohair@286 248 case 0:
ohair@286 249 {
ohair@286 250 revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
ohair@286 251 }
ohair@286 252 break;
ohair@286 253 default:
ohair@286 254 {
ohair@286 255 unexpectedEnterAttribute($__qname);
ohair@286 256 }
ohair@286 257 break;
ohair@286 258 }
ohair@286 259 }
ohair@286 260
ohair@286 261 public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 262 int $ai;
ohair@286 263 $uri = $__uri;
ohair@286 264 $localName = $__local;
ohair@286 265 $qname = $__qname;
ohair@286 266 switch($_ngcc_current_state) {
mkos@397 267 case 1:
mkos@397 268 {
mkos@397 269 $_ngcc_current_state = 0;
mkos@397 270 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 271 }
mkos@397 272 break;
ohair@286 273 case 5:
ohair@286 274 {
ohair@286 275 $_ngcc_current_state = 1;
ohair@286 276 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 277 }
ohair@286 278 break;
ohair@286 279 case 6:
ohair@286 280 {
ohair@286 281 if(($__uri.equals("") && $__local.equals("processContents"))) {
ohair@286 282 $_ngcc_current_state = 1;
ohair@286 283 }
ohair@286 284 else {
ohair@286 285 unexpectedLeaveAttribute($__qname);
ohair@286 286 }
ohair@286 287 }
ohair@286 288 break;
mkos@397 289 case 9:
mkos@397 290 {
mkos@397 291 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
mkos@397 292 spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
mkos@397 293 }
mkos@397 294 break;
mkos@397 295 case 10:
mkos@397 296 {
mkos@397 297 $_ngcc_current_state = 9;
mkos@397 298 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
mkos@397 299 }
mkos@397 300 break;
ohair@286 301 case 0:
ohair@286 302 {
ohair@286 303 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
ohair@286 304 }
ohair@286 305 break;
mkos@397 306 case 2:
mkos@397 307 {
mkos@397 308 if(($__uri.equals("") && $__local.equals("namespace"))) {
mkos@397 309 $_ngcc_current_state = 0;
mkos@397 310 }
mkos@397 311 else {
mkos@397 312 unexpectedLeaveAttribute($__qname);
mkos@397 313 }
mkos@397 314 }
mkos@397 315 break;
ohair@286 316 default:
ohair@286 317 {
ohair@286 318 unexpectedLeaveAttribute($__qname);
ohair@286 319 }
ohair@286 320 break;
ohair@286 321 }
ohair@286 322 }
ohair@286 323
ohair@286 324 public void text(String $value) throws SAXException {
ohair@286 325 int $ai;
ohair@286 326 switch($_ngcc_current_state) {
mkos@397 327 case 1:
mkos@397 328 {
mkos@397 329 if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
mkos@397 330 $runtime.consumeAttribute($ai);
mkos@397 331 $runtime.sendText(super._cookie, $value);
mkos@397 332 }
mkos@397 333 else {
mkos@397 334 $_ngcc_current_state = 0;
mkos@397 335 $runtime.sendText(super._cookie, $value);
mkos@397 336 }
mkos@397 337 }
mkos@397 338 break;
mkos@397 339 case 3:
mkos@397 340 {
mkos@397 341 ns = $value;
mkos@397 342 $_ngcc_current_state = 2;
mkos@397 343 }
mkos@397 344 break;
ohair@286 345 case 5:
ohair@286 346 {
ohair@286 347 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
ohair@286 348 $runtime.consumeAttribute($ai);
ohair@286 349 $runtime.sendText(super._cookie, $value);
ohair@286 350 }
ohair@286 351 else {
ohair@286 352 $_ngcc_current_state = 1;
ohair@286 353 $runtime.sendText(super._cookie, $value);
ohair@286 354 }
ohair@286 355 }
ohair@286 356 break;
ohair@286 357 case 9:
ohair@286 358 {
mkos@397 359 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
mkos@397 360 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 361 spawnChildFromText(h, $value);
ohair@286 362 }
ohair@286 363 else {
mkos@397 364 if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
mkos@397 365 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 366 spawnChildFromText(h, $value);
ohair@286 367 }
ohair@286 368 else {
mkos@397 369 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
ohair@286 370 spawnChildFromText(h, $value);
ohair@286 371 }
ohair@286 372 }
ohair@286 373 }
ohair@286 374 break;
ohair@286 375 case 10:
ohair@286 376 {
ohair@286 377 $_ngcc_current_state = 9;
ohair@286 378 $runtime.sendText(super._cookie, $value);
ohair@286 379 }
ohair@286 380 break;
ohair@286 381 case 0:
ohair@286 382 {
ohair@286 383 revertToParentFromText(makeResult(), super._cookie, $value);
ohair@286 384 }
ohair@286 385 break;
mkos@397 386 case 7:
mkos@397 387 {
mkos@397 388 modeValue = $value;
mkos@397 389 $_ngcc_current_state = 6;
mkos@397 390 }
mkos@397 391 break;
ohair@286 392 }
ohair@286 393 }
ohair@286 394
ohair@286 395 public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
ohair@286 396 switch($__cookie__) {
mkos@397 397 case 409:
ohair@286 398 {
ohair@286 399 fa = ((ForeignAttributesImpl)$__result__);
ohair@286 400 $_ngcc_current_state = 5;
ohair@286 401 }
ohair@286 402 break;
mkos@397 403 case 411:
ohair@286 404 {
ohair@286 405 annotation = ((AnnotationImpl)$__result__);
ohair@286 406 $_ngcc_current_state = 9;
ohair@286 407 }
ohair@286 408 break;
ohair@286 409 }
ohair@286 410 }
ohair@286 411
ohair@286 412 public boolean accepted() {
mkos@397 413 return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 5) || ($_ngcc_current_state == 1))));
ohair@286 414 }
ohair@286 415
ohair@286 416
ohair@286 417 private WildcardImpl makeResult() {
ohair@286 418 if(modeValue==null) modeValue="strict";
ohair@286 419
ohair@286 420 int mode=-1;
ohair@286 421 if(modeValue.equals("strict")) mode = XSWildcard.STRTICT;
ohair@286 422 if(modeValue.equals("lax")) mode = XSWildcard.LAX;
ohair@286 423 if(modeValue.equals("skip")) mode = XSWildcard.SKIP;
ohair@286 424 if(mode==-1) throw new InternalError();
ohair@286 425
ohair@286 426 if(ns==null || ns.equals("##any"))
ohair@286 427 return new WildcardImpl.Any( $runtime.document, annotation,locator,fa,mode);
ohair@286 428
ohair@286 429 if(ns.equals("##other"))
ohair@286 430 return new WildcardImpl.Other( $runtime.document,
ohair@286 431 annotation,locator,fa,
ohair@286 432 $runtime.currentSchema.getTargetNamespace(),mode);
ohair@286 433
ohair@286 434 StringTokenizer tokens = new StringTokenizer(ns);
ohair@286 435 HashSet s = new HashSet();
ohair@286 436 while(tokens.hasMoreTokens()) {
ohair@286 437 String ns = tokens.nextToken();
ohair@286 438 if(ns.equals("##local")) ns="";
ohair@286 439 if(ns.equals("##targetNamespace")) ns=$runtime.currentSchema.getTargetNamespace();
ohair@286 440 s.add(ns);
ohair@286 441 }
ohair@286 442
ohair@286 443 return new WildcardImpl.Finite( $runtime.document, annotation,locator,fa,s,mode);
ohair@286 444 }
ohair@286 445
ohair@286 446 }

mercurial