1 7 package org.omg.CORBA; 8 9 10 19 20 abstract public class IdentifierHelper 21 { 22 private static String _id = "IDL:omg.org/CORBA/Identifier:1.0"; 23 24 public static void insert (org.omg.CORBA.Any a, String that) 25 { 26 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 27 a.type (type ()); 28 write (out, that); 29 a.read_value (out.create_input_stream (), type ()); 30 } 31 32 public static String extract (org.omg.CORBA.Any a) 33 { 34 return read (a.create_input_stream ()); 35 } 36 37 private static org.omg.CORBA.TypeCode __typeCode = null; 38 synchronized public static org.omg.CORBA.TypeCode type () 39 { 40 if (__typeCode == null) 41 { 42 __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); 43 __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", __typeCode); 44 } 45 return __typeCode; 46 } 47 48 public static String id () 49 { 50 return _id; 51 } 52 53 public static String read (org.omg.CORBA.portable.InputStream istream) 54 { 55 String value = null; 56 value = istream.read_string (); 57 return value; 58 } 59 60 public static void write (org.omg.CORBA.portable.OutputStream ostream, String value) 61 { 62 ostream.write_string (value); 63 } 64 65 } 66 | Popular Tags |