1. /*
  2. * @(#)DefinitionKind.java 1.30 03/01/23
  3. *
  4. * Copyright 2003 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. * The class that provides the constants used to identify the type of an
  16. * Interface Repository object. This class contains two kinds of constants,
  17. * those that are an <code>int</code> and those that are an instance of the class
  18. * <code>DefinitionKind</code>. This class provides the method
  19. * <code>from_int</code>, which given one
  20. * of the <code>int</code> constants, creates the corresponding
  21. * <code>DefinitionKind</code> instance. It also provides the method
  22. * <code>value</code>, which returns the <code>int</code> constant that
  23. * is the value for a <code>DefinitionKind</code> instance.
  24. *
  25. * @see IRObject
  26. */
  27. public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity {
  28. /**
  29. * The constant that indicates that an Interface Repository object
  30. * does not have a definition kind.
  31. */
  32. public static final int _dk_none = 0,
  33. /**
  34. * The constant that indicates that the type of an Interface Repository object
  35. * may be any type.
  36. */
  37. _dk_all = 1,
  38. /**
  39. * The constant that indicates that an Interface Repository object is an
  40. * attribute.
  41. */
  42. _dk_Attribute = 2,
  43. /**
  44. * The constant that indicates that an Interface Repository object is a
  45. * constant.
  46. */
  47. _dk_Constant = 3,
  48. /**
  49. * The constant that indicates that an Interface Repository object is an
  50. * exception.
  51. */
  52. _dk_Exception = 4,
  53. /**
  54. * The constant that indicates that an Interface Repository object is an
  55. * interface.
  56. */
  57. _dk_Interface = 5,
  58. /**
  59. * The constant that indicates that an Interface Repository object is a
  60. * module.
  61. */
  62. _dk_Module = 6,
  63. /**
  64. * The constant that indicates that an Interface Repository object is an
  65. * operation.
  66. */
  67. _dk_Operation = 7,
  68. /**
  69. * The constant that indicates that an Interface Repository object is a
  70. * Typedef.
  71. */
  72. _dk_Typedef = 8,
  73. /**
  74. * The constant that indicates that an Interface Repository object is an
  75. * Alias.
  76. */
  77. _dk_Alias = 9,
  78. /**
  79. * The constant that indicates that an Interface Repository object is a
  80. * Struct.
  81. */
  82. _dk_Struct = 10,
  83. /**
  84. * The constant that indicates that an Interface Repository object is a
  85. * Union.
  86. */
  87. _dk_Union = 11,
  88. /**
  89. * The constant that indicates that an Interface Repository object is an
  90. * Enum.
  91. */
  92. _dk_Enum = 12,
  93. /**
  94. * The constant that indicates that an Interface Repository object is a
  95. * Primitive.
  96. */
  97. _dk_Primitive = 13,
  98. /**
  99. * The constant that indicates that an Interface Repository object is a
  100. * String.
  101. */
  102. _dk_String = 14,
  103. /**
  104. * The constant that indicates that an Interface Repository object is a
  105. * Sequence.
  106. */
  107. _dk_Sequence = 15,
  108. /**
  109. * The constant that indicates that an Interface Repository object is an
  110. * Array.
  111. */
  112. _dk_Array = 16,
  113. /**
  114. * The constant that indicates that an Interface Repository object is a
  115. * Repository.
  116. */
  117. _dk_Repository = 17,
  118. /**
  119. * The constant that indicates that an Interface Repository object is a
  120. * Wstring.
  121. */
  122. _dk_Wstring = 18,
  123. /**
  124. * The constant that indicates that an Interface Repository object is of type
  125. * Fixed.
  126. */
  127. _dk_Fixed = 19,
  128. /**
  129. * The constant that indicates that an Interface Repository object is a
  130. * Value.
  131. */
  132. _dk_Value = 20,
  133. /**
  134. * The constant that indicates that an Interface Repository object is a
  135. * ValueBox.
  136. */
  137. _dk_ValueBox = 21,
  138. /**
  139. * The constant that indicates that an Interface Repository object is a
  140. * ValueMember.
  141. */
  142. _dk_ValueMember = 22,
  143. /**
  144. * The constant that indicates that an Interface Repository object is of type
  145. * Native.
  146. */
  147. _dk_Native = 23,
  148. /**
  149. * The constant that indicates that an Interface Repository object
  150. * is representing an abstract interface.
  151. */
  152. _dk_AbstractInterface = 24;
  153. /**
  154. * The static instance of <code>DefinitionKind</code> indicating that an
  155. * Interface Repository object has no definition kind.
  156. */
  157. public static final DefinitionKind dk_none = new DefinitionKind(_dk_none);
  158. /**
  159. * The wildcard <code>DefinitionKind</code> constant, useful
  160. * in all occasions where any
  161. * <code>DefinitionKind</code> is appropriate. The Container's
  162. * <code>contents</code> method
  163. * makes use of this constant to return all contained definitions of any kind.
  164. */
  165. public static final DefinitionKind dk_all = new DefinitionKind(_dk_all);
  166. /**
  167. * The static instance of <code>DefinitionKind</code> indicating that an
  168. * Interface Repository object is an Attribute.
  169. */
  170. public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute);
  171. /**
  172. * The static instance of <code>DefinitionKind</code> indicating that an
  173. * Interface Repository object is a constant.
  174. */
  175. public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant);
  176. /**
  177. * The static instance of <code>DefinitionKind</code> indicating that an
  178. * Interface Repository object is an Exception.
  179. */
  180. public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception);
  181. /**
  182. * The static instance of <code>DefinitionKind</code> indicating that an
  183. * Interface Repository object is an Interface.
  184. */
  185. public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface);
  186. /**
  187. * The static instance of <code>DefinitionKind</code> indicating that an
  188. * Interface Repository object is a Module.
  189. */
  190. public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module);
  191. /**
  192. * The static instance of <code>DefinitionKind</code> indicating that an
  193. * Interface Repository object is an Operation.
  194. */
  195. public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation);
  196. /**
  197. * The static instance of <code>DefinitionKind</code> indicating that an
  198. * Interface Repository object is a Typedef.
  199. */
  200. public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef);
  201. /**
  202. * The static instance of <code>DefinitionKind</code> indicating that an
  203. * Interface Repository object is an Alias.
  204. */
  205. public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias);
  206. /**
  207. * The static instance of <code>DefinitionKind</code> indicating that an
  208. * Interface Repository object is a Struct.
  209. */
  210. public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct);
  211. /**
  212. * The static instance of <code>DefinitionKind</code> indicating that an
  213. * Interface Repository object is a Union.
  214. */
  215. public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union);
  216. /**
  217. * The static instance of <code>DefinitionKind</code> indicating that an
  218. * Interface Repository object is an Enum.
  219. */
  220. public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum);
  221. /**
  222. * The static instance of <code>DefinitionKind</code> indicating that an
  223. * Interface Repository object is a Primitive.
  224. */
  225. public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive);
  226. /**
  227. * The static instance of <code>DefinitionKind</code> indicating that an
  228. * Interface Repository object is a String.
  229. */
  230. public static final DefinitionKind dk_String = new DefinitionKind(_dk_String);
  231. /**
  232. * The static instance of <code>DefinitionKind</code> indicating that an
  233. * Interface Repository object is a Sequence.
  234. */
  235. public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence);
  236. /**
  237. * The static instance of <code>DefinitionKind</code> indicating that an
  238. * Interface Repository object is an Array.
  239. */
  240. public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array);
  241. /**
  242. * The static instance of <code>DefinitionKind</code> indicating that an
  243. * Interface Repository object is a Repository.
  244. */
  245. public static final DefinitionKind dk_Repository = new DefinitionKind(_dk_Repository);
  246. /**
  247. * The static instance of <code>DefinitionKind</code> indicating that an
  248. * Interface Repository object is a Wstring.
  249. */
  250. public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring);
  251. /**
  252. * The static instance of <code>DefinitionKind</code> indicating that an
  253. * Interface Repository object is a Fixed value.
  254. */
  255. public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed);
  256. /**
  257. * The static instance of <code>DefinitionKind</code> indicating that an
  258. * Interface Repository object is a Value.
  259. */
  260. public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value);
  261. /**
  262. * The static instance of <code>DefinitionKind</code> indicating that an
  263. * Interface Repository object is a ValueBox.
  264. */
  265. public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox);
  266. /**
  267. * The static instance of <code>DefinitionKind</code> indicating that an
  268. * Interface Repository object is a ValueMember.
  269. */
  270. public static final DefinitionKind dk_ValueMember = new DefinitionKind(_dk_ValueMember);
  271. /**
  272. * The static instance of <code>DefinitionKind</code> indicating that an
  273. * Interface Repository object is a Native value.
  274. */
  275. public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native);
  276. /**
  277. * The static instance of <code>DefinitionKind</code> indicating that an
  278. * Interface Repository object represents an abstract interface.
  279. */
  280. public static final DefinitionKind dk_AbstractInterface = new DefinitionKind(_dk_AbstractInterface);
  281. /**
  282. * Returns the <code>int</code> constant identifying the type of an IR object.
  283. * @return the <code>int</code> constant from the class
  284. * <code>DefinitionKind</code> that is the value of this
  285. * <code>DefinitionKind</code> instance
  286. */
  287. public int value() {
  288. return _value;
  289. }
  290. /**
  291. * Creates a <code>DefinitionKind</code> instance corresponding to the given code
  292. .
  293. * @param i one of the <code>int</code> constants from the class
  294. * <code>DefinitionKind</code>
  295. * @return the <code>DefinitionKind</code> instance corresponding
  296. * to the given code
  297. * @throws org.omg.CORBA.BAD_PARAM if the given parameter is not
  298. one
  299. * of the <code>int</code> constants from the class
  300. * <code>DefinitionKind</code>
  301. */
  302. public static DefinitionKind from_int(int i) {
  303. switch (i) {
  304. case _dk_none:
  305. return dk_none;
  306. case _dk_all:
  307. return dk_all;
  308. case _dk_Attribute:
  309. return dk_Attribute;
  310. case _dk_Constant:
  311. return dk_Constant;
  312. case _dk_Exception:
  313. return dk_Exception;
  314. case _dk_Interface:
  315. return dk_Interface;
  316. case _dk_Module:
  317. return dk_Module;
  318. case _dk_Operation:
  319. return dk_Operation;
  320. case _dk_Typedef:
  321. return dk_Typedef;
  322. case _dk_Alias:
  323. return dk_Alias;
  324. case _dk_Struct:
  325. return dk_Struct;
  326. case _dk_Union:
  327. return dk_Union;
  328. case _dk_Enum:
  329. return dk_Enum;
  330. case _dk_Primitive:
  331. return dk_Primitive;
  332. case _dk_String:
  333. return dk_String;
  334. case _dk_Sequence:
  335. return dk_Sequence;
  336. case _dk_Array:
  337. return dk_Array;
  338. case _dk_Repository:
  339. return dk_Repository;
  340. case _dk_Wstring:
  341. return dk_Wstring;
  342. case _dk_Fixed:
  343. return dk_Fixed;
  344. case _dk_Value:
  345. return dk_Value;
  346. case _dk_ValueBox:
  347. return dk_ValueBox;
  348. case _dk_ValueMember:
  349. return dk_ValueMember;
  350. case _dk_Native:
  351. return dk_Native;
  352. default:
  353. throw new org.omg.CORBA.BAD_PARAM();
  354. }
  355. }
  356. /**
  357. * Constructs a <code>DefinitionKind</code> object with its <code>_value</code>
  358. * field initialized with the given value.
  359. * @param _value one of the <code>int</code> constants defined in the
  360. * class <code>DefinitionKind</code>
  361. */
  362. protected DefinitionKind(int _value){
  363. this._value = _value;
  364. }
  365. /**
  366. * The field that holds a value for a <code>DefinitionKind</code> object.
  367. * @serial
  368. */
  369. private int _value;
  370. }