1. /*
  2. * @(#)DefinitionKind.java 1.16 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/CORBA/DefinitionKind.java
  9. * From: ./ir.idl
  10. * Date: Fri Aug 28 16:03:31 1998
  11. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  12. */
  13. package org.omg.CORBA;
  14. /**
  15. * This class defines the constants used to identify the type of an Interface Repository object.
  16. * @see IRObject
  17. */
  18. public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity {
  19. public static final int _dk_none = 0,
  20. _dk_all = 1,
  21. _dk_Attribute = 2,
  22. _dk_Constant = 3,
  23. _dk_Exception = 4,
  24. _dk_Interface = 5,
  25. _dk_Module = 6,
  26. _dk_Operation = 7,
  27. _dk_Typedef = 8,
  28. _dk_Alias = 9,
  29. _dk_Struct = 10,
  30. _dk_Union = 11,
  31. _dk_Enum = 12,
  32. _dk_Primitive = 13,
  33. _dk_String = 14,
  34. _dk_Sequence = 15,
  35. _dk_Array = 16,
  36. _dk_Repository = 17,
  37. _dk_Wstring = 18,
  38. _dk_Fixed = 19,
  39. _dk_Value = 20,
  40. _dk_ValueBox = 21,
  41. _dk_ValueMember = 22,
  42. _dk_Native = 23;
  43. public static final DefinitionKind dk_none = new DefinitionKind(_dk_none);
  44. /** The wildcard definition kind, useful in all occasions where any
  45. * <code>DefinitionKind</code> is appropriate. The Containers contents method
  46. * makes use of this to return all contained definitions of any kind.*/
  47. public static final DefinitionKind dk_all = new DefinitionKind(_dk_all);
  48. public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute);
  49. public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant);
  50. public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception);
  51. public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface);
  52. public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module);
  53. public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation);
  54. public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef);
  55. public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias);
  56. public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct);
  57. public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union);
  58. public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum);
  59. public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive);
  60. public static final DefinitionKind dk_String = new DefinitionKind(_dk_String);
  61. public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence);
  62. public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array);
  63. public static final DefinitionKind dk_Repository = new DefinitionKind(_dk_Repository);
  64. public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring);
  65. public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed);
  66. public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value);
  67. public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox);
  68. public static final DefinitionKind dk_ValueMember = new DefinitionKind(_dk_ValueMember);
  69. public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native);
  70. /**
  71. * Returns the code identifying the type of an IR object.
  72. * @return the code of this DefinitionKind.
  73. */
  74. public int value() {
  75. return _value;
  76. }
  77. /**
  78. * Returns the DefinitionKind corresponding to the given code.
  79. * @param i the code of a DefinitionKind.
  80. */
  81. public static DefinitionKind from_int(int i) throws org.omg.CORBA.BAD_PARAM {
  82. switch (i) {
  83. case _dk_none:
  84. return dk_none;
  85. case _dk_all:
  86. return dk_all;
  87. case _dk_Attribute:
  88. return dk_Attribute;
  89. case _dk_Constant:
  90. return dk_Constant;
  91. case _dk_Exception:
  92. return dk_Exception;
  93. case _dk_Interface:
  94. return dk_Interface;
  95. case _dk_Module:
  96. return dk_Module;
  97. case _dk_Operation:
  98. return dk_Operation;
  99. case _dk_Typedef:
  100. return dk_Typedef;
  101. case _dk_Alias:
  102. return dk_Alias;
  103. case _dk_Struct:
  104. return dk_Struct;
  105. case _dk_Union:
  106. return dk_Union;
  107. case _dk_Enum:
  108. return dk_Enum;
  109. case _dk_Primitive:
  110. return dk_Primitive;
  111. case _dk_String:
  112. return dk_String;
  113. case _dk_Sequence:
  114. return dk_Sequence;
  115. case _dk_Array:
  116. return dk_Array;
  117. case _dk_Repository:
  118. return dk_Repository;
  119. case _dk_Wstring:
  120. return dk_Wstring;
  121. case _dk_Fixed:
  122. return dk_Fixed;
  123. case _dk_Value:
  124. return dk_Value;
  125. case _dk_ValueBox:
  126. return dk_ValueBox;
  127. case _dk_ValueMember:
  128. return dk_ValueMember;
  129. case _dk_Native:
  130. return dk_Native;
  131. default:
  132. throw new org.omg.CORBA.BAD_PARAM();
  133. }
  134. }
  135. protected DefinitionKind(int _value){
  136. this._value = _value;
  137. }
  138. /**
  139. * @serial
  140. */
  141. private int _value;
  142. }