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