1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/org/omg/CORBA/DefinitionKind.java Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,501 @@ 1.4 +/* 1.5 + * Copyright 1997-2001 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Sun designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Sun in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.26 + * have any questions. 1.27 + */ 1.28 + 1.29 +/* 1.30 + * File: ./org/omg/CORBA/DefinitionKind.java 1.31 + * From: ./ir.idl 1.32 + * Date: Fri Aug 28 16:03:31 1998 1.33 + * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18 1.34 + */ 1.35 + 1.36 +package org.omg.CORBA; 1.37 + 1.38 +/** 1.39 +* The class that provides the constants used to identify the type of an 1.40 +* Interface Repository object. This class contains two kinds of constants, 1.41 +* those that are an <code>int</code> and those that are an instance of the class 1.42 +* <code>DefinitionKind</code>. This class provides the method 1.43 +* <code>from_int</code>, which given one 1.44 +* of the <code>int</code> constants, creates the corresponding 1.45 +* <code>DefinitionKind</code> instance. It also provides the method 1.46 +* <code>value</code>, which returns the <code>int</code> constant that 1.47 +* is the value for a <code>DefinitionKind</code> instance. 1.48 +* 1.49 +* @see IRObject 1.50 +*/ 1.51 + 1.52 +public class DefinitionKind implements org.omg.CORBA.portable.IDLEntity { 1.53 + 1.54 +/** 1.55 + * The constant that indicates that an Interface Repository object 1.56 + * does not have a definition kind. 1.57 + */ 1.58 + public static final int _dk_none = 0, 1.59 + 1.60 +/** 1.61 + * The constant that indicates that the type of an Interface Repository object 1.62 + * may be any type. 1.63 + */ 1.64 + _dk_all = 1, 1.65 + 1.66 +/** 1.67 + * The constant that indicates that an Interface Repository object is an 1.68 + * attribute. 1.69 + */ 1.70 + _dk_Attribute = 2, 1.71 + 1.72 +/** 1.73 + * The constant that indicates that an Interface Repository object is a 1.74 + * constant. 1.75 + */ 1.76 + _dk_Constant = 3, 1.77 + 1.78 +/** 1.79 + * The constant that indicates that an Interface Repository object is an 1.80 + * exception. 1.81 + */ 1.82 + 1.83 + _dk_Exception = 4, 1.84 + 1.85 +/** 1.86 + * The constant that indicates that an Interface Repository object is an 1.87 + * interface. 1.88 + */ 1.89 + 1.90 + _dk_Interface = 5, 1.91 + 1.92 +/** 1.93 + * The constant that indicates that an Interface Repository object is a 1.94 + * module. 1.95 + */ 1.96 + 1.97 + _dk_Module = 6, 1.98 + 1.99 +/** 1.100 + * The constant that indicates that an Interface Repository object is an 1.101 + * operation. 1.102 + */ 1.103 + 1.104 + _dk_Operation = 7, 1.105 + 1.106 +/** 1.107 + * The constant that indicates that an Interface Repository object is a 1.108 + * Typedef. 1.109 + */ 1.110 + 1.111 + _dk_Typedef = 8, 1.112 + 1.113 +/** 1.114 + * The constant that indicates that an Interface Repository object is an 1.115 + * Alias. 1.116 + */ 1.117 + 1.118 + _dk_Alias = 9, 1.119 + 1.120 +/** 1.121 + * The constant that indicates that an Interface Repository object is a 1.122 + * Struct. 1.123 + */ 1.124 + 1.125 + _dk_Struct = 10, 1.126 + 1.127 +/** 1.128 + * The constant that indicates that an Interface Repository object is a 1.129 + * Union. 1.130 + */ 1.131 + 1.132 + _dk_Union = 11, 1.133 + 1.134 +/** 1.135 + * The constant that indicates that an Interface Repository object is an 1.136 + * Enum. 1.137 + */ 1.138 + 1.139 + _dk_Enum = 12, 1.140 + 1.141 +/** 1.142 + * The constant that indicates that an Interface Repository object is a 1.143 + * Primitive. 1.144 + */ 1.145 + 1.146 + _dk_Primitive = 13, 1.147 + 1.148 +/** 1.149 + * The constant that indicates that an Interface Repository object is a 1.150 + * String. 1.151 + */ 1.152 + 1.153 + _dk_String = 14, 1.154 + 1.155 +/** 1.156 + * The constant that indicates that an Interface Repository object is a 1.157 + * Sequence. 1.158 + */ 1.159 + 1.160 + _dk_Sequence = 15, 1.161 + 1.162 +/** 1.163 + * The constant that indicates that an Interface Repository object is an 1.164 + * Array. 1.165 + */ 1.166 + 1.167 + _dk_Array = 16, 1.168 + 1.169 +/** 1.170 + * The constant that indicates that an Interface Repository object is a 1.171 + * Repository. 1.172 + */ 1.173 + 1.174 + _dk_Repository = 17, 1.175 + 1.176 +/** 1.177 + * The constant that indicates that an Interface Repository object is a 1.178 + * Wstring. 1.179 + */ 1.180 + 1.181 + _dk_Wstring = 18, 1.182 + 1.183 +/** 1.184 + * The constant that indicates that an Interface Repository object is of type 1.185 + * Fixed. 1.186 + */ 1.187 + 1.188 + _dk_Fixed = 19, 1.189 + 1.190 +/** 1.191 + * The constant that indicates that an Interface Repository object is a 1.192 + * Value. 1.193 + */ 1.194 + 1.195 + _dk_Value = 20, 1.196 + 1.197 +/** 1.198 + * The constant that indicates that an Interface Repository object is a 1.199 + * ValueBox. 1.200 + */ 1.201 + 1.202 + _dk_ValueBox = 21, 1.203 + 1.204 +/** 1.205 + * The constant that indicates that an Interface Repository object is a 1.206 + * ValueMember. 1.207 + */ 1.208 + 1.209 + _dk_ValueMember = 22, 1.210 + 1.211 +/** 1.212 + * The constant that indicates that an Interface Repository object is of type 1.213 + * Native. 1.214 + */ 1.215 + 1.216 + _dk_Native = 23, 1.217 + 1.218 +/** 1.219 + * The constant that indicates that an Interface Repository object 1.220 + * is representing an abstract interface. 1.221 + */ 1.222 + _dk_AbstractInterface = 24; 1.223 + 1.224 +/** 1.225 + * The static instance of <code>DefinitionKind</code> indicating that an 1.226 + * Interface Repository object has no definition kind. 1.227 + */ 1.228 + 1.229 + public static final DefinitionKind dk_none = new DefinitionKind(_dk_none); 1.230 + 1.231 + /** 1.232 + * The wildcard <code>DefinitionKind</code> constant, useful 1.233 + * in all occasions where any 1.234 + * <code>DefinitionKind</code> is appropriate. The Container's 1.235 + * <code>contents</code> method 1.236 + * makes use of this constant to return all contained definitions of any kind. 1.237 + */ 1.238 + 1.239 + public static final DefinitionKind dk_all = new DefinitionKind(_dk_all); 1.240 + 1.241 +/** 1.242 + * The static instance of <code>DefinitionKind</code> indicating that an 1.243 + * Interface Repository object is an Attribute. 1.244 + */ 1.245 + 1.246 + public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute); 1.247 + 1.248 +/** 1.249 + * The static instance of <code>DefinitionKind</code> indicating that an 1.250 + * Interface Repository object is a constant. 1.251 + */ 1.252 + 1.253 + public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant); 1.254 + 1.255 + 1.256 +/** 1.257 + * The static instance of <code>DefinitionKind</code> indicating that an 1.258 + * Interface Repository object is an Exception. 1.259 + */ 1.260 + 1.261 + public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception); 1.262 + 1.263 +/** 1.264 + * The static instance of <code>DefinitionKind</code> indicating that an 1.265 + * Interface Repository object is an Interface. 1.266 + */ 1.267 + 1.268 + public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface); 1.269 + 1.270 +/** 1.271 + * The static instance of <code>DefinitionKind</code> indicating that an 1.272 + * Interface Repository object is a Module. 1.273 + */ 1.274 + 1.275 + public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module); 1.276 + 1.277 +/** 1.278 + * The static instance of <code>DefinitionKind</code> indicating that an 1.279 + * Interface Repository object is an Operation. 1.280 + */ 1.281 + 1.282 + public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation); 1.283 + 1.284 +/** 1.285 + * The static instance of <code>DefinitionKind</code> indicating that an 1.286 + * Interface Repository object is a Typedef. 1.287 + */ 1.288 + 1.289 + public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef); 1.290 + 1.291 +/** 1.292 + * The static instance of <code>DefinitionKind</code> indicating that an 1.293 + * Interface Repository object is an Alias. 1.294 + */ 1.295 + 1.296 + public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias); 1.297 + 1.298 +/** 1.299 + * The static instance of <code>DefinitionKind</code> indicating that an 1.300 + * Interface Repository object is a Struct. 1.301 + */ 1.302 + 1.303 + public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct); 1.304 + 1.305 +/** 1.306 + * The static instance of <code>DefinitionKind</code> indicating that an 1.307 + * Interface Repository object is a Union. 1.308 + */ 1.309 + 1.310 + public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union); 1.311 + 1.312 +/** 1.313 + * The static instance of <code>DefinitionKind</code> indicating that an 1.314 + * Interface Repository object is an Enum. 1.315 + */ 1.316 + 1.317 + public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum); 1.318 + 1.319 +/** 1.320 + * The static instance of <code>DefinitionKind</code> indicating that an 1.321 + * Interface Repository object is a Primitive. 1.322 + */ 1.323 + 1.324 + public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive); 1.325 + 1.326 +/** 1.327 + * The static instance of <code>DefinitionKind</code> indicating that an 1.328 + * Interface Repository object is a String. 1.329 + */ 1.330 + 1.331 + public static final DefinitionKind dk_String = new DefinitionKind(_dk_String); 1.332 + 1.333 +/** 1.334 + * The static instance of <code>DefinitionKind</code> indicating that an 1.335 + * Interface Repository object is a Sequence. 1.336 + */ 1.337 + 1.338 + public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence); 1.339 + 1.340 +/** 1.341 + * The static instance of <code>DefinitionKind</code> indicating that an 1.342 + * Interface Repository object is an Array. 1.343 + */ 1.344 + 1.345 + public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array); 1.346 + 1.347 + 1.348 +/** 1.349 + * The static instance of <code>DefinitionKind</code> indicating that an 1.350 + * Interface Repository object is a Repository. 1.351 + */ 1.352 + 1.353 + public static final DefinitionKind dk_Repository = new DefinitionKind(_dk_Repository); 1.354 + 1.355 + 1.356 +/** 1.357 + * The static instance of <code>DefinitionKind</code> indicating that an 1.358 + * Interface Repository object is a Wstring. 1.359 + */ 1.360 + 1.361 + public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring); 1.362 + 1.363 +/** 1.364 + * The static instance of <code>DefinitionKind</code> indicating that an 1.365 + * Interface Repository object is a Fixed value. 1.366 + */ 1.367 + 1.368 + public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed); 1.369 + 1.370 +/** 1.371 + * The static instance of <code>DefinitionKind</code> indicating that an 1.372 + * Interface Repository object is a Value. 1.373 + */ 1.374 + 1.375 + public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value); 1.376 + 1.377 +/** 1.378 + * The static instance of <code>DefinitionKind</code> indicating that an 1.379 + * Interface Repository object is a ValueBox. 1.380 + */ 1.381 + 1.382 + public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox); 1.383 + 1.384 +/** 1.385 + * The static instance of <code>DefinitionKind</code> indicating that an 1.386 + * Interface Repository object is a ValueMember. 1.387 + */ 1.388 + 1.389 + public static final DefinitionKind dk_ValueMember = new DefinitionKind(_dk_ValueMember); 1.390 + 1.391 + 1.392 +/** 1.393 + * The static instance of <code>DefinitionKind</code> indicating that an 1.394 + * Interface Repository object is a Native value. 1.395 + */ 1.396 + 1.397 + public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native); 1.398 + 1.399 + 1.400 +/** 1.401 +* The static instance of <code>DefinitionKind</code> indicating that an 1.402 +* Interface Repository object represents an abstract interface. 1.403 +*/ 1.404 + public static final DefinitionKind dk_AbstractInterface = new DefinitionKind(_dk_AbstractInterface); 1.405 + 1.406 + 1.407 + /** 1.408 + * Returns the <code>int</code> constant identifying the type of an IR object. 1.409 + * @return the <code>int</code> constant from the class 1.410 + * <code>DefinitionKind</code> that is the value of this 1.411 + * <code>DefinitionKind</code> instance 1.412 + */ 1.413 + 1.414 + public int value() { 1.415 + return _value; 1.416 + } 1.417 + 1.418 + 1.419 + /** 1.420 + * Creates a <code>DefinitionKind</code> instance corresponding to the given code 1.421 +. 1.422 + * @param i one of the <code>int</code> constants from the class 1.423 + * <code>DefinitionKind</code> 1.424 + * @return the <code>DefinitionKind</code> instance corresponding 1.425 + * to the given code 1.426 + * @throws org.omg.CORBA.BAD_PARAM if the given parameter is not 1.427 + one 1.428 + * of the <code>int</code> constants from the class 1.429 + * <code>DefinitionKind</code> 1.430 + */ 1.431 + 1.432 + public static DefinitionKind from_int(int i) { 1.433 + switch (i) { 1.434 + case _dk_none: 1.435 + return dk_none; 1.436 + case _dk_all: 1.437 + return dk_all; 1.438 + case _dk_Attribute: 1.439 + return dk_Attribute; 1.440 + case _dk_Constant: 1.441 + return dk_Constant; 1.442 + case _dk_Exception: 1.443 + return dk_Exception; 1.444 + case _dk_Interface: 1.445 + return dk_Interface; 1.446 + case _dk_Module: 1.447 + return dk_Module; 1.448 + case _dk_Operation: 1.449 + return dk_Operation; 1.450 + case _dk_Typedef: 1.451 + return dk_Typedef; 1.452 + case _dk_Alias: 1.453 + return dk_Alias; 1.454 + case _dk_Struct: 1.455 + return dk_Struct; 1.456 + case _dk_Union: 1.457 + return dk_Union; 1.458 + case _dk_Enum: 1.459 + return dk_Enum; 1.460 + case _dk_Primitive: 1.461 + return dk_Primitive; 1.462 + case _dk_String: 1.463 + return dk_String; 1.464 + case _dk_Sequence: 1.465 + return dk_Sequence; 1.466 + case _dk_Array: 1.467 + return dk_Array; 1.468 + case _dk_Repository: 1.469 + return dk_Repository; 1.470 + case _dk_Wstring: 1.471 + return dk_Wstring; 1.472 + case _dk_Fixed: 1.473 + return dk_Fixed; 1.474 + case _dk_Value: 1.475 + return dk_Value; 1.476 + case _dk_ValueBox: 1.477 + return dk_ValueBox; 1.478 + case _dk_ValueMember: 1.479 + return dk_ValueMember; 1.480 + case _dk_Native: 1.481 + return dk_Native; 1.482 + default: 1.483 + throw new org.omg.CORBA.BAD_PARAM(); 1.484 + } 1.485 + } 1.486 + 1.487 + /** 1.488 + * Constructs a <code>DefinitionKind</code> object with its <code>_value</code> 1.489 + * field initialized with the given value. 1.490 + * @param _value one of the <code>int</code> constants defined in the 1.491 + * class <code>DefinitionKind</code> 1.492 + */ 1.493 + 1.494 + protected DefinitionKind(int _value){ 1.495 + this._value = _value; 1.496 + } 1.497 + 1.498 + /** 1.499 + * The field that holds a value for a <code>DefinitionKind</code> object. 1.500 + * @serial 1.501 + */ 1.502 + 1.503 + private int _value; 1.504 +}