1 7 8 package com.sun.corba.se.impl.dynamicany; 9 10 import org.omg.CORBA.Any ; 11 import org.omg.CORBA.TypeCode ; 12 import org.omg.CORBA.portable.OutputStream ; 13 import org.omg.DynamicAny.*; 14 import org.omg.DynamicAny.DynAnyPackage.TypeMismatch ; 15 import org.omg.DynamicAny.DynAnyPackage.InvalidValue ; 16 import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ; 17 import com.sun.corba.se.impl.corba.TypeCodeImpl; 19 import com.sun.corba.se.spi.orb.ORB ; 20 import com.sun.corba.se.spi.logging.CORBALogDomains ; 21 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 22 23 abstract class DynAnyConstructedImpl extends DynAnyImpl 24 { 25 protected static final byte REPRESENTATION_NONE = 0; 26 protected static final byte REPRESENTATION_TYPECODE = 1; 27 protected static final byte REPRESENTATION_ANY = 2; 28 protected static final byte REPRESENTATION_COMPONENTS = 4; 29 30 protected static final byte RECURSIVE_UNDEF = -1; 31 protected static final byte RECURSIVE_NO = 0; 32 protected static final byte RECURSIVE_YES = 1; 33 34 protected static final DynAny[] emptyComponents = new DynAny[0]; 35 39 DynAny[] components = emptyComponents; 41 byte representations = REPRESENTATION_NONE; 42 byte isRecursive = RECURSIVE_UNDEF; 43 44 48 private DynAnyConstructedImpl() { 49 this(null, (Any )null, false); 50 } 51 52 protected DynAnyConstructedImpl(ORB orb, Any any, boolean copyValue) { 53 super(orb, any, copyValue); 54 if (this.any != null) { 56 representations = REPRESENTATION_ANY; 57 } 58 index = 0; 60 } 61 62 protected DynAnyConstructedImpl(ORB orb, TypeCode typeCode) { 63 super(orb, typeCode); 66 if (typeCode != null) { 67 representations = REPRESENTATION_TYPECODE; 68 } 69 index = NO_INDEX; 71 72 } 77 78 protected boolean isRecursive() { 79 if (isRecursive == RECURSIVE_UNDEF) { 80 TypeCode typeCode = any.type(); 81 if (typeCode instanceof TypeCodeImpl) { 82 if (((TypeCodeImpl)typeCode).is_recursive()) 83 isRecursive = RECURSIVE_YES; 84 else 85 isRecursive = RECURSIVE_NO; 86 } else { 87 isRecursive = RECURSIVE_NO; 89 } 90 } 91 return (isRecursive == RECURSIVE_YES); 92 } 93 94 98 public org.omg.DynamicAny.DynAny current_component() 99 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch 100 { 101 if (status == STATUS_DESTROYED) { 102 throw wrapper.dynAnyDestroyed() ; 103 } 104 if (index == NO_INDEX) { 105 return null; 106 } 107 return (checkInitComponents() ? components[index] : null); 108 } 109 110 public int component_count() { 111 if (status == STATUS_DESTROYED) { 112 throw wrapper.dynAnyDestroyed() ; 113 } 114 return (checkInitComponents() ? components.length : 0); 115 } 116 117 public boolean next() { 118 if (status == STATUS_DESTROYED) { 119 throw wrapper.dynAnyDestroyed() ; 120 } 121 if (checkInitComponents() == false) { 122 return false; 123 } 124 index++; 125 if (index >= 0 && index < components.length) { 126 return true; 127 } else { 128 index = NO_INDEX; 129 return false; 130 } 131 } 132 133 public boolean seek(int newIndex) { 134 if (status == STATUS_DESTROYED) { 135 throw wrapper.dynAnyDestroyed() ; 136 } 137 if (newIndex < 0) { 138 this.index = NO_INDEX; 139 return false; 140 } 141 if (checkInitComponents() == false) { 142 return false; 143 } 144 if (newIndex < components.length) { 145 index = newIndex; 146 return true; 147 } 148 return false; 149 } 150 151 public void rewind() { 152 if (status == STATUS_DESTROYED) { 153 throw wrapper.dynAnyDestroyed() ; 154 } 155 this.seek(0); 156 } 157 158 162 protected void clearData() { 163 super.clearData(); 164 components = emptyComponents; 166 index = NO_INDEX; 167 representations = REPRESENTATION_NONE; 168 } 169 170 protected void writeAny(OutputStream out) { 171 checkInitAny(); 175 super.writeAny(out); 176 } 177 178 protected boolean checkInitComponents() { 180 if ((representations & REPRESENTATION_COMPONENTS) == 0) { 181 if ((representations & REPRESENTATION_ANY) != 0) { 182 if (initializeComponentsFromAny()) { 183 representations |= REPRESENTATION_COMPONENTS; 184 } else { 185 return false; 186 } 187 } else if ((representations & REPRESENTATION_TYPECODE) != 0) { 188 if (initializeComponentsFromTypeCode()) { 189 representations |= REPRESENTATION_COMPONENTS; 190 } else { 191 return false; 192 } 193 } 194 } 195 return true; 196 } 197 198 protected void checkInitAny() { 200 if ((representations & REPRESENTATION_ANY) == 0) { 201 if ((representations & REPRESENTATION_COMPONENTS) != 0) { 203 if (initializeAnyFromComponents()) { 205 representations |= REPRESENTATION_ANY; 206 } 207 } else if ((representations & REPRESENTATION_TYPECODE) != 0) { 208 if (representations == REPRESENTATION_TYPECODE && isRecursive()) 210 return; 211 if (initializeComponentsFromTypeCode()) { 212 representations |= REPRESENTATION_COMPONENTS; 213 } 214 if (initializeAnyFromComponents()) { 215 representations |= REPRESENTATION_ANY; 216 } 217 } 218 } else { 219 } 221 return; 222 } 223 224 protected abstract boolean initializeComponentsFromAny(); 225 protected abstract boolean initializeComponentsFromTypeCode(); 226 227 protected boolean initializeAnyFromComponents() { 229 OutputStream out = any.create_output_stream(); 231 for (int i=0; i<components.length; i++) { 232 if (components[i] instanceof DynAnyImpl) { 233 ((DynAnyImpl)components[i]).writeAny(out); 234 } else { 235 components[i].to_any().write_value(out); 237 } 238 } 239 any.read_value(out.create_input_stream(), any.type()); 240 return true; 241 } 242 243 247 public void assign (org.omg.DynamicAny.DynAny dyn_any) 248 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch 249 { 250 if (status == STATUS_DESTROYED) { 251 throw wrapper.dynAnyDestroyed() ; 252 } 253 clearData(); 254 super.assign(dyn_any); 255 representations = REPRESENTATION_ANY; 256 index = 0; 257 } 258 259 public void from_any (org.omg.CORBA.Any value) 260 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 261 org.omg.DynamicAny.DynAnyPackage.InvalidValue 262 { 263 if (status == STATUS_DESTROYED) { 264 throw wrapper.dynAnyDestroyed() ; 265 } 266 clearData(); 267 super.from_any(value); 268 representations = REPRESENTATION_ANY; 269 index = 0; 270 } 271 272 public org.omg.CORBA.Any to_any() { 274 if (status == STATUS_DESTROYED) { 276 throw wrapper.dynAnyDestroyed() ; 277 } 278 checkInitAny(); 279 return DynAnyUtil.copy(any, orb); 281 } 282 283 public boolean equal (org.omg.DynamicAny.DynAny dyn_any) { 284 if (status == STATUS_DESTROYED) { 285 throw wrapper.dynAnyDestroyed() ; 286 } 287 if (dyn_any == this) { 288 return true; 289 } 290 if ( ! any.type().equal(dyn_any.type())) { 291 return false; 292 } 293 if (checkInitComponents() == false) { 296 return false; 297 } 298 DynAny currentComponent = null; 299 try { 300 currentComponent = dyn_any.current_component(); 302 for (int i=0; i<components.length; i++) { 303 if (dyn_any.seek(i) == false) 304 return false; 305 if ( ! components[i].equal(dyn_any.current_component())) { 308 return false; 310 } 311 } 312 } catch (TypeMismatch tm) { 313 } finally { 315 DynAnyUtil.set_current_component(dyn_any, currentComponent); 317 } 318 return true; 319 } 320 321 public void destroy() { 322 if (status == STATUS_DESTROYED) { 323 throw wrapper.dynAnyDestroyed() ; 324 } 325 if (status == STATUS_DESTROYABLE) { 326 status = STATUS_DESTROYED; 327 for (int i=0; i<components.length; i++) { 328 if (components[i] instanceof DynAnyImpl) { 329 ((DynAnyImpl)components[i]).setStatus(STATUS_DESTROYABLE); 330 } 331 components[i].destroy(); 332 } 333 } 334 } 335 336 public org.omg.DynamicAny.DynAny copy() { 337 if (status == STATUS_DESTROYED) { 338 throw wrapper.dynAnyDestroyed() ; 339 } 340 checkInitAny(); 341 try { 342 return DynAnyUtil.createMostDerivedDynAny(any, orb, true); 343 } catch (InconsistentTypeCode ictc) { 344 return null; } 346 } 347 348 350 public void insert_boolean(boolean value) 351 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 352 org.omg.DynamicAny.DynAnyPackage.InvalidValue 353 { 354 if (status == STATUS_DESTROYED) { 355 throw wrapper.dynAnyDestroyed() ; 356 } 357 if (index == NO_INDEX) 358 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 359 DynAny currentComponent = current_component(); 360 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 361 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 362 currentComponent.insert_boolean(value); 363 } 364 365 public void insert_octet(byte value) 366 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 367 org.omg.DynamicAny.DynAnyPackage.InvalidValue 368 { 369 if (status == STATUS_DESTROYED) { 370 throw wrapper.dynAnyDestroyed() ; 371 } 372 if (index == NO_INDEX) 373 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 374 DynAny currentComponent = current_component(); 375 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 376 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 377 currentComponent.insert_octet(value); 378 } 379 380 public void insert_char(char value) 381 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 382 org.omg.DynamicAny.DynAnyPackage.InvalidValue 383 { 384 if (status == STATUS_DESTROYED) { 385 throw wrapper.dynAnyDestroyed() ; 386 } 387 if (index == NO_INDEX) 388 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 389 DynAny currentComponent = current_component(); 390 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 391 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 392 currentComponent.insert_char(value); 393 } 394 395 public void insert_short(short value) 396 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 397 org.omg.DynamicAny.DynAnyPackage.InvalidValue 398 { 399 if (status == STATUS_DESTROYED) { 400 throw wrapper.dynAnyDestroyed() ; 401 } 402 if (index == NO_INDEX) 403 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 404 DynAny currentComponent = current_component(); 405 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 406 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 407 currentComponent.insert_short(value); 408 } 409 410 public void insert_ushort(short value) 411 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 412 org.omg.DynamicAny.DynAnyPackage.InvalidValue 413 { 414 if (status == STATUS_DESTROYED) { 415 throw wrapper.dynAnyDestroyed() ; 416 } 417 if (index == NO_INDEX) 418 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 419 DynAny currentComponent = current_component(); 420 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 421 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 422 currentComponent.insert_ushort(value); 423 } 424 425 public void insert_long(int value) 426 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 427 org.omg.DynamicAny.DynAnyPackage.InvalidValue 428 { 429 if (status == STATUS_DESTROYED) { 430 throw wrapper.dynAnyDestroyed() ; 431 } 432 if (index == NO_INDEX) 433 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 434 DynAny currentComponent = current_component(); 435 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 436 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 437 currentComponent.insert_long(value); 438 } 439 440 public void insert_ulong(int value) 441 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 442 org.omg.DynamicAny.DynAnyPackage.InvalidValue 443 { 444 if (status == STATUS_DESTROYED) { 445 throw wrapper.dynAnyDestroyed() ; 446 } 447 if (index == NO_INDEX) 448 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 449 DynAny currentComponent = current_component(); 450 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 451 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 452 currentComponent.insert_ulong(value); 453 } 454 455 public void insert_float(float value) 456 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 457 org.omg.DynamicAny.DynAnyPackage.InvalidValue 458 { 459 if (status == STATUS_DESTROYED) { 460 throw wrapper.dynAnyDestroyed() ; 461 } 462 if (index == NO_INDEX) 463 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 464 DynAny currentComponent = current_component(); 465 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 466 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 467 currentComponent.insert_float(value); 468 } 469 470 public void insert_double(double value) 471 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 472 org.omg.DynamicAny.DynAnyPackage.InvalidValue 473 { 474 if (status == STATUS_DESTROYED) { 475 throw wrapper.dynAnyDestroyed() ; 476 } 477 if (index == NO_INDEX) 478 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 479 DynAny currentComponent = current_component(); 480 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 481 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 482 currentComponent.insert_double(value); 483 } 484 485 public void insert_string(String value) 486 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 487 org.omg.DynamicAny.DynAnyPackage.InvalidValue 488 { 489 if (status == STATUS_DESTROYED) { 490 throw wrapper.dynAnyDestroyed() ; 491 } 492 if (index == NO_INDEX) 493 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 494 DynAny currentComponent = current_component(); 495 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 496 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 497 currentComponent.insert_string(value); 498 } 499 500 public void insert_reference(org.omg.CORBA.Object value) 501 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 502 org.omg.DynamicAny.DynAnyPackage.InvalidValue 503 { 504 if (status == STATUS_DESTROYED) { 505 throw wrapper.dynAnyDestroyed() ; 506 } 507 if (index == NO_INDEX) 508 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 509 DynAny currentComponent = current_component(); 510 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 511 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 512 currentComponent.insert_reference(value); 513 } 514 515 public void insert_typecode(org.omg.CORBA.TypeCode value) 516 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 517 org.omg.DynamicAny.DynAnyPackage.InvalidValue 518 { 519 if (status == STATUS_DESTROYED) { 520 throw wrapper.dynAnyDestroyed() ; 521 } 522 if (index == NO_INDEX) 523 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 524 DynAny currentComponent = current_component(); 525 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 526 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 527 currentComponent.insert_typecode(value); 528 } 529 530 public void insert_longlong(long value) 531 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 532 org.omg.DynamicAny.DynAnyPackage.InvalidValue 533 { 534 if (status == STATUS_DESTROYED) { 535 throw wrapper.dynAnyDestroyed() ; 536 } 537 if (index == NO_INDEX) 538 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 539 DynAny currentComponent = current_component(); 540 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 541 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 542 currentComponent.insert_longlong(value); 543 } 544 545 public void insert_ulonglong(long value) 546 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 547 org.omg.DynamicAny.DynAnyPackage.InvalidValue 548 { 549 if (status == STATUS_DESTROYED) { 550 throw wrapper.dynAnyDestroyed() ; 551 } 552 if (index == NO_INDEX) 553 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 554 DynAny currentComponent = current_component(); 555 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 556 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 557 currentComponent.insert_ulonglong(value); 558 } 559 560 public void insert_wchar(char value) 561 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 562 org.omg.DynamicAny.DynAnyPackage.InvalidValue 563 { 564 if (status == STATUS_DESTROYED) { 565 throw wrapper.dynAnyDestroyed() ; 566 } 567 if (index == NO_INDEX) 568 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 569 DynAny currentComponent = current_component(); 570 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 571 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 572 currentComponent.insert_wchar(value); 573 } 574 575 public void insert_wstring(String value) 576 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 577 org.omg.DynamicAny.DynAnyPackage.InvalidValue 578 { 579 if (status == STATUS_DESTROYED) { 580 throw wrapper.dynAnyDestroyed() ; 581 } 582 if (index == NO_INDEX) 583 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 584 DynAny currentComponent = current_component(); 585 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 586 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 587 currentComponent.insert_wstring(value); 588 } 589 590 public void insert_any(org.omg.CORBA.Any value) 591 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 592 org.omg.DynamicAny.DynAnyPackage.InvalidValue 593 { 594 if (status == STATUS_DESTROYED) { 595 throw wrapper.dynAnyDestroyed() ; 596 } 597 if (index == NO_INDEX) 598 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 599 DynAny currentComponent = current_component(); 600 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 601 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 602 currentComponent.insert_any(value); 603 } 604 605 public void insert_dyn_any (org.omg.DynamicAny.DynAny value) 606 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 607 org.omg.DynamicAny.DynAnyPackage.InvalidValue 608 { 609 if (status == STATUS_DESTROYED) { 610 throw wrapper.dynAnyDestroyed() ; 611 } 612 if (index == NO_INDEX) 613 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 614 DynAny currentComponent = current_component(); 615 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 616 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 617 currentComponent.insert_dyn_any(value); 618 } 619 620 public void insert_val(java.io.Serializable value) 621 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 622 org.omg.DynamicAny.DynAnyPackage.InvalidValue 623 { 624 if (status == STATUS_DESTROYED) { 625 throw wrapper.dynAnyDestroyed() ; 626 } 627 if (index == NO_INDEX) 628 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 629 DynAny currentComponent = current_component(); 630 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 631 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 632 currentComponent.insert_val(value); 633 } 634 635 public java.io.Serializable get_val() 636 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 637 org.omg.DynamicAny.DynAnyPackage.InvalidValue 638 { 639 if (status == STATUS_DESTROYED) { 640 throw wrapper.dynAnyDestroyed() ; 641 } 642 if (index == NO_INDEX) 643 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 644 DynAny currentComponent = current_component(); 645 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 646 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 647 return currentComponent.get_val(); 648 } 649 650 public boolean get_boolean() 651 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 652 org.omg.DynamicAny.DynAnyPackage.InvalidValue 653 { 654 if (status == STATUS_DESTROYED) { 655 throw wrapper.dynAnyDestroyed() ; 656 } 657 if (index == NO_INDEX) 658 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 659 DynAny currentComponent = current_component(); 660 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 661 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 662 return currentComponent.get_boolean(); 663 } 664 665 public byte get_octet() 666 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 667 org.omg.DynamicAny.DynAnyPackage.InvalidValue 668 { 669 if (status == STATUS_DESTROYED) { 670 throw wrapper.dynAnyDestroyed() ; 671 } 672 if (index == NO_INDEX) 673 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 674 DynAny currentComponent = current_component(); 675 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 676 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 677 return currentComponent.get_octet(); 678 } 679 680 public char get_char() 681 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 682 org.omg.DynamicAny.DynAnyPackage.InvalidValue 683 { 684 if (status == STATUS_DESTROYED) { 685 throw wrapper.dynAnyDestroyed() ; 686 } 687 if (index == NO_INDEX) 688 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 689 DynAny currentComponent = current_component(); 690 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 691 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 692 return currentComponent.get_char(); 693 } 694 695 public short get_short() 696 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 697 org.omg.DynamicAny.DynAnyPackage.InvalidValue 698 { 699 if (status == STATUS_DESTROYED) { 700 throw wrapper.dynAnyDestroyed() ; 701 } 702 if (index == NO_INDEX) 703 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 704 DynAny currentComponent = current_component(); 705 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 706 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 707 return currentComponent.get_short(); 708 } 709 710 public short get_ushort() 711 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 712 org.omg.DynamicAny.DynAnyPackage.InvalidValue 713 { 714 if (status == STATUS_DESTROYED) { 715 throw wrapper.dynAnyDestroyed() ; 716 } 717 if (index == NO_INDEX) 718 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 719 DynAny currentComponent = current_component(); 720 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 721 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 722 return currentComponent.get_ushort(); 723 } 724 725 public int get_long() 726 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 727 org.omg.DynamicAny.DynAnyPackage.InvalidValue 728 { 729 if (status == STATUS_DESTROYED) { 730 throw wrapper.dynAnyDestroyed() ; 731 } 732 if (index == NO_INDEX) 733 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 734 DynAny currentComponent = current_component(); 735 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 736 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 737 return currentComponent.get_long(); 738 } 739 740 public int get_ulong() 741 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 742 org.omg.DynamicAny.DynAnyPackage.InvalidValue 743 { 744 if (status == STATUS_DESTROYED) { 745 throw wrapper.dynAnyDestroyed() ; 746 } 747 if (index == NO_INDEX) 748 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 749 DynAny currentComponent = current_component(); 750 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 751 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 752 return currentComponent.get_ulong(); 753 } 754 755 public float get_float() 756 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 757 org.omg.DynamicAny.DynAnyPackage.InvalidValue 758 { 759 if (status == STATUS_DESTROYED) { 760 throw wrapper.dynAnyDestroyed() ; 761 } 762 if (index == NO_INDEX) 763 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 764 DynAny currentComponent = current_component(); 765 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 766 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 767 return currentComponent.get_float(); 768 } 769 770 public double get_double() 771 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 772 org.omg.DynamicAny.DynAnyPackage.InvalidValue 773 { 774 if (status == STATUS_DESTROYED) { 775 throw wrapper.dynAnyDestroyed() ; 776 } 777 if (index == NO_INDEX) 778 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 779 DynAny currentComponent = current_component(); 780 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 781 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 782 return currentComponent.get_double(); 783 } 784 785 public String get_string() 786 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 787 org.omg.DynamicAny.DynAnyPackage.InvalidValue 788 { 789 if (status == STATUS_DESTROYED) { 790 throw wrapper.dynAnyDestroyed() ; 791 } 792 if (index == NO_INDEX) 793 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 794 DynAny currentComponent = current_component(); 795 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 796 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 797 return currentComponent.get_string(); 798 } 799 800 public org.omg.CORBA.Object get_reference() 801 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 802 org.omg.DynamicAny.DynAnyPackage.InvalidValue 803 { 804 if (status == STATUS_DESTROYED) { 805 throw wrapper.dynAnyDestroyed() ; 806 } 807 if (index == NO_INDEX) 808 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 809 DynAny currentComponent = current_component(); 810 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 811 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 812 return currentComponent.get_reference(); 813 } 814 815 public org.omg.CORBA.TypeCode get_typecode() 816 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 817 org.omg.DynamicAny.DynAnyPackage.InvalidValue 818 { 819 if (status == STATUS_DESTROYED) { 820 throw wrapper.dynAnyDestroyed() ; 821 } 822 if (index == NO_INDEX) 823 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 824 DynAny currentComponent = current_component(); 825 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 826 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 827 return currentComponent.get_typecode(); 828 } 829 830 public long get_longlong() 831 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 832 org.omg.DynamicAny.DynAnyPackage.InvalidValue 833 { 834 if (status == STATUS_DESTROYED) { 835 throw wrapper.dynAnyDestroyed() ; 836 } 837 if (index == NO_INDEX) 838 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 839 DynAny currentComponent = current_component(); 840 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 841 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 842 return currentComponent.get_longlong(); 843 } 844 845 public long get_ulonglong() 846 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 847 org.omg.DynamicAny.DynAnyPackage.InvalidValue 848 { 849 if (status == STATUS_DESTROYED) { 850 throw wrapper.dynAnyDestroyed() ; 851 } 852 if (index == NO_INDEX) 853 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 854 DynAny currentComponent = current_component(); 855 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 856 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 857 return currentComponent.get_ulonglong(); 858 } 859 860 public char get_wchar() 861 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 862 org.omg.DynamicAny.DynAnyPackage.InvalidValue 863 { 864 if (status == STATUS_DESTROYED) { 865 throw wrapper.dynAnyDestroyed() ; 866 } 867 if (index == NO_INDEX) 868 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 869 DynAny currentComponent = current_component(); 870 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 871 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 872 return currentComponent.get_wchar(); 873 } 874 875 public String get_wstring() 876 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 877 org.omg.DynamicAny.DynAnyPackage.InvalidValue 878 { 879 if (status == STATUS_DESTROYED) { 880 throw wrapper.dynAnyDestroyed() ; 881 } 882 if (index == NO_INDEX) 883 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 884 DynAny currentComponent = current_component(); 885 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 886 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 887 return currentComponent.get_wstring(); 888 } 889 890 public org.omg.CORBA.Any get_any() 891 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 892 org.omg.DynamicAny.DynAnyPackage.InvalidValue 893 { 894 if (status == STATUS_DESTROYED) { 895 throw wrapper.dynAnyDestroyed() ; 896 } 897 if (index == NO_INDEX) 898 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 899 DynAny currentComponent = current_component(); 900 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 901 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 902 return currentComponent.get_any(); 903 } 904 905 public org.omg.DynamicAny.DynAny get_dyn_any() 906 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 907 org.omg.DynamicAny.DynAnyPackage.InvalidValue 908 { 909 if (status == STATUS_DESTROYED) { 910 throw wrapper.dynAnyDestroyed() ; 911 } 912 if (index == NO_INDEX) 913 throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue (); 914 DynAny currentComponent = current_component(); 915 if (DynAnyUtil.isConstructedDynAny(currentComponent)) 916 throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch (); 917 return currentComponent.get_dyn_any(); 918 } 919 } 920 | Popular Tags |