1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/NameHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl
  6. * Wednesday, September 15, 2004 10:28:47 AM GMT
  7. */
  8. /**
  9. * A name is a sequence of name components.
  10. */
  11. abstract public class NameHelper
  12. {
  13. private static String _id = "IDL:omg.org/CosNaming/Name:1.0";
  14. public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.NameComponent[] that)
  15. {
  16. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  17. a.type (type ());
  18. write (out, that);
  19. a.read_value (out.create_input_stream (), type ());
  20. }
  21. public static org.omg.CosNaming.NameComponent[] extract (org.omg.CORBA.Any a)
  22. {
  23. return read (a.create_input_stream ());
  24. }
  25. private static org.omg.CORBA.TypeCode __typeCode = null;
  26. synchronized public static org.omg.CORBA.TypeCode type ()
  27. {
  28. if (__typeCode == null)
  29. {
  30. __typeCode = org.omg.CosNaming.NameComponentHelper.type ();
  31. __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
  32. __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CosNaming.NameHelper.id (), "Name", __typeCode);
  33. }
  34. return __typeCode;
  35. }
  36. public static String id ()
  37. {
  38. return _id;
  39. }
  40. public static org.omg.CosNaming.NameComponent[] read (org.omg.CORBA.portable.InputStream istream)
  41. {
  42. org.omg.CosNaming.NameComponent value[] = null;
  43. int _len0 = istream.read_long ();
  44. value = new org.omg.CosNaming.NameComponent[_len0];
  45. for (int _o1 = 0;_o1 < value.length; ++_o1)
  46. value[_o1] = org.omg.CosNaming.NameComponentHelper.read (istream);
  47. return value;
  48. }
  49. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.NameComponent[] value)
  50. {
  51. ostream.write_long (value.length);
  52. for (int _i0 = 0;_i0 < value.length; ++_i0)
  53. org.omg.CosNaming.NameComponentHelper.write (ostream, value[_i0]);
  54. }
  55. }