1 7 8 9 14 15 23 24 package org.omg.CORBA; 25 26 44 45 public class WStringValueHelper implements org.omg.CORBA.portable.BoxedValueHelper 46 { 47 private static String _id = "IDL:omg.org/CORBA/WStringValue:1.0"; 48 49 private static WStringValueHelper _instance = new WStringValueHelper (); 50 51 public static void insert (org.omg.CORBA.Any a, String that) 52 { 53 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 54 a.type (type ()); 55 write (out, that); 56 a.read_value (out.create_input_stream (), type ()); 57 } 58 59 public static String extract (org.omg.CORBA.Any a) 60 { 61 return read (a.create_input_stream ()); 62 } 63 64 private static org.omg.CORBA.TypeCode __typeCode = null; 65 private static boolean __active = false; 66 synchronized public static org.omg.CORBA.TypeCode type () 67 { 68 if (__typeCode == null) 69 { 70 synchronized (org.omg.CORBA.TypeCode .class) 71 { 72 if (__typeCode == null) 73 { 74 if (__active) 75 { 76 return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); 77 } 78 __active = true; 79 __typeCode = org.omg.CORBA.ORB.init ().create_wstring_tc (0); 80 __typeCode = org.omg.CORBA.ORB.init ().create_value_box_tc (_id, "WStringValue", __typeCode); 81 __active = false; 82 } 83 } 84 } 85 return __typeCode; 86 } 87 88 public static String id () 89 { 90 return _id; 91 } 92 93 public static String read (org.omg.CORBA.portable.InputStream istream) 94 { 95 if (!(istream instanceof org.omg.CORBA_2_3.portable.InputStream )) { 96 throw new org.omg.CORBA.BAD_PARAM (); } 97 return (String ) ((org.omg.CORBA_2_3.portable.InputStream ) istream).read_value (_instance); 98 } 99 100 public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream) 101 { 102 String tmp; 103 tmp = istream.read_wstring (); 104 return (java.io.Serializable ) tmp; 105 } 106 107 public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) 108 { 109 if (!(ostream instanceof org.omg.CORBA_2_3.portable.OutputStream )) { 110 throw new org.omg.CORBA.BAD_PARAM (); } 111 ((org.omg.CORBA_2_3.portable.OutputStream ) ostream).write_value (value, _instance); 112 } 113 114 public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value) 115 { 116 if (!(value instanceof String )) { 117 throw new org.omg.CORBA.MARSHAL (); } 118 String valueType = (String ) value; 119 ostream.write_wstring (valueType); 120 } 121 122 public String get_id () 123 { 124 return _id; 125 } 126 127 } 128 | Popular Tags |