1. /*
  2. * @(#)UnionMemberHelper.java 1.4 00/02/02
  3. *
  4. * Copyright 1999, 2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package org.omg.CORBA;
  11. /**
  12. * org/omg/CORBA/UnionMemberHelper.java
  13. * Generated by the IDL-to-Java compiler (portable), version "3.0"
  14. * from ir.idl
  15. * 03 June 1999 11:33:43 o'clock GMT+00:00
  16. */
  17. abstract public class UnionMemberHelper
  18. {
  19. private static String _id = "IDL:omg.org/CORBA/UnionMember:1.0";
  20. public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.UnionMember that)
  21. {
  22. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  23. a.type (type ());
  24. write (out, that);
  25. a.read_value (out.create_input_stream (), type ());
  26. }
  27. public static org.omg.CORBA.UnionMember extract (org.omg.CORBA.Any a)
  28. {
  29. return read (a.create_input_stream ());
  30. }
  31. private static org.omg.CORBA.TypeCode __typeCode = null;
  32. private static boolean __active = false;
  33. synchronized public static org.omg.CORBA.TypeCode type ()
  34. {
  35. if (__typeCode == null)
  36. {
  37. synchronized (org.omg.CORBA.TypeCode.class)
  38. {
  39. if (__typeCode == null)
  40. {
  41. if (__active)
  42. {
  43. return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
  44. }
  45. __active = true;
  46. org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [4];
  47. org.omg.CORBA.TypeCode _tcOf_members0 = null;
  48. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
  49. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0);
  50. _members0[0] = new org.omg.CORBA.StructMember (
  51. "name",
  52. _tcOf_members0,
  53. null);
  54. _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any);
  55. _members0[1] = new org.omg.CORBA.StructMember (
  56. "label",
  57. _tcOf_members0,
  58. null);
  59. _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode);
  60. _members0[2] = new org.omg.CORBA.StructMember (
  61. "type",
  62. _tcOf_members0,
  63. null);
  64. _tcOf_members0 = org.omg.CORBA.IDLTypeHelper.type ();
  65. _members0[3] = new org.omg.CORBA.StructMember (
  66. "type_def",
  67. _tcOf_members0,
  68. null);
  69. __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.UnionMemberHelper.id (), "UnionMember", _members0);
  70. __active = false;
  71. }
  72. }
  73. }
  74. return __typeCode;
  75. }
  76. public static String id ()
  77. {
  78. return _id;
  79. }
  80. public static org.omg.CORBA.UnionMember read (org.omg.CORBA.portable.InputStream istream)
  81. {
  82. org.omg.CORBA.UnionMember value = new org.omg.CORBA.UnionMember ();
  83. value.name = istream.read_string ();
  84. value.label = istream.read_any ();
  85. value.type = istream.read_TypeCode ();
  86. value.type_def = org.omg.CORBA.IDLTypeHelper.read (istream);
  87. return value;
  88. }
  89. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.UnionMember value)
  90. {
  91. ostream.write_string (value.name);
  92. ostream.write_any (value.label);
  93. ostream.write_TypeCode (value.type);
  94. org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def);
  95. }
  96. }