1. /*
  2. * @(#)NameComponentHelper.java 1.10 00/02/02
  3. *
  4. * Copyright 1997-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. /*
  11. * File: ./org/omg/CosNaming/NameComponentHelper.java
  12. * From: nameservice.idl
  13. * Date: Tue Aug 11 03:12:09 1998
  14. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  15. */
  16. package org.omg.CosNaming;
  17. public class NameComponentHelper {
  18. // It is useless to have instances of this class
  19. private NameComponentHelper() { }
  20. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CosNaming.NameComponent that) {
  21. out.write_string(that.id);
  22. out.write_string(that.kind);
  23. }
  24. public static org.omg.CosNaming.NameComponent read(org.omg.CORBA.portable.InputStream in) {
  25. org.omg.CosNaming.NameComponent that = new org.omg.CosNaming.NameComponent();
  26. that.id = in.read_string();
  27. that.kind = in.read_string();
  28. return that;
  29. }
  30. public static org.omg.CosNaming.NameComponent extract(org.omg.CORBA.Any a) {
  31. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  32. return read(in);
  33. }
  34. public static void insert(org.omg.CORBA.Any a, org.omg.CosNaming.NameComponent that) {
  35. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  36. write(out, that);
  37. a.read_value(out.create_input_stream(), type());
  38. }
  39. private static org.omg.CORBA.TypeCode _tc;
  40. synchronized public static org.omg.CORBA.TypeCode type() {
  41. int _memberCount = 2;
  42. org.omg.CORBA.StructMember[] _members = null;
  43. if (_tc == null) {
  44. _members= new org.omg.CORBA.StructMember[2];
  45. _members[0] = new org.omg.CORBA.StructMember(
  46. "id",
  47. org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string),
  48. null);
  49. _members[1] = new org.omg.CORBA.StructMember(
  50. "kind",
  51. org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string),
  52. null);
  53. _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "NameComponent", _members);
  54. }
  55. return _tc;
  56. }
  57. public static String id() {
  58. return "IDL:omg.org/CosNaming/NameComponent:1.0";
  59. }
  60. }