1. /*
  2. * @(#)Initializer.java 1.6 00/02/02
  3. *
  4. * Copyright 1999, 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. package org.omg.CORBA;
  11. /**
  12. *
  13. * This is the mapping for an IDL structure which specifies
  14. * an initializer for a value type. A value can contain all the
  15. * elements that an interface can as well as the definition of
  16. * state members, and initializers for that state. In order to
  17. * ensure portability of value implementations, designers may
  18. * also define the signatures of initializers (or constructors) for
  19. * non abstract value types. Syntactically these look like local
  20. * operations except that they use the keyword init for the "name" of
  21. * the operation, have no return type, and must use only in parameters.
  22. * There may be any number of init declarations, as long as the signatures
  23. * of all the initializers declared within the same scope are unique.
  24. * Using the same signature as one found in a less-derived type is allowed.
  25. * The mapping of initializers is language specific and may not always
  26. * result in a one to one correspondence between initializer signatures
  27. * and the programming language constructs into which they map. This is
  28. * because the mapping from IDL types into programming language types is
  29. * not isomorphic; several different IDL types may map to the same
  30. * programming language type. Hence defining initializers with the same
  31. * number of parameters with types that are "similar" (e.g. char and wchar,
  32. * signed and unsigned integers, etc.) should be done with care. Value types
  33. * may also be abstract. They are called abstract because an abstract value
  34. * type may not be instantiated. No <state_members> or <initializers> may
  35. * be specified. However, local operations may be specified.
  36. * Essentially they are a bundle of operation signatures with a purely
  37. * local implementation. Note that a concrete value type with an
  38. * empty state is not an abstract value type.
  39. * The following shows an example of defining a value type with an
  40. * initializer.
  41. * Example:
  42. *
  43. * valuetype EmployeeRecord {
  44. *
  45. * private string name;
  46. * private string email;
  47. * private string SSN;
  48. *
  49. * init(in string name, in string SSN);
  50. * };
  51. *
  52. * Value types do not map to org.omg.CORBA.Object's.
  53. *
  54. */
  55. public final class Initializer implements org.omg.CORBA.portable.IDLEntity
  56. {
  57. /**
  58. * members contains the reference to all the Initializers of non abstract
  59. * value types.
  60. */
  61. public org.omg.CORBA.StructMember members[] = null;
  62. /**
  63. * Constructs an Initializer object with the members attribute null.
  64. */
  65. public Initializer ()
  66. {
  67. } // ctor
  68. /**
  69. * Constructs an Initializer object and assigns the members attribute
  70. * with the given parameter.
  71. *
  72. * @param _members an array of StructMember Objects.
  73. */
  74. public Initializer (org.omg.CORBA.StructMember[] _members)
  75. {
  76. members = _members;
  77. } // ctor
  78. } // class Initializer