Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: javax/enterprise/deploy/shared/DConfigBeanVersionType.java


1   /**
2    *
3    * Copyright 2003-2004 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17  
18  //
19  // This source code implements specifications defined by the Java
20  // Community Process. In order to remain compliant with the specification
21  // DO NOT add / change / or delete method signatures!
22  //
23  
24  package javax.enterprise.deploy.shared;
25  
26  /**
27   * Class DConfigBeanVersionTypes defines enumeration values for the J2EE
28   * Platform verion number.
29   *
30   * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
31   */
32  public class DConfigBeanVersionType {
33      /**
34       * J2EE Platform version 1.3
35       */
36      public static final DConfigBeanVersionType V1_3 = new DConfigBeanVersionType(0);
37      /**
38       * J2EE Platform version 1.3.1
39       */
40      public static final DConfigBeanVersionType V1_3_1 = new DConfigBeanVersionType(1);
41      /**
42       * J2EE Platform version 1.4
43       */
44      public static final DConfigBeanVersionType V1_4 = new DConfigBeanVersionType(2);
45  
46      private static final DConfigBeanVersionType[] enumValueTable = {
47          V1_3,
48          V1_3_1,
49          V1_4,
50      };
51  
52      private static final String[] stringTable = {
53          "V1_3",
54          "V1_3_1",
55          "V1_4",
56      };
57  
58      private int value;
59  
60      /**
61       * Construct a new enumeration value with the given integer value.
62       */
63      protected DConfigBeanVersionType(int value) {
64          this.value = value;
65      }
66  
67      /**
68       * Returns this enumeration value's integer value.
69       */
70      public int getValue() {
71          return value;
72      }
73  
74      /**
75       * Returns the string table for class DConfigBeanVersionType
76       */
77      protected String[] getStringTable() {
78          return stringTable;
79      }
80  
81      /**
82       * Returns the enumeration value table for class DConfigBeanVersionType
83       */
84      protected DConfigBeanVersionType[] getEnumValueTable() {
85          return enumValueTable;
86      }
87  
88      /**
89       * Return an object of the specified value.
90       *
91       * @param value a designator for the object.
92       */
93      public static DConfigBeanVersionType getDConfigBeanVersionType(int value) {
94          return enumValueTable[value];
95      }
96  
97      /**
98       * Return the string name of this DConfigBeanVersionType or the integer
99       * value if outside the bounds of the table
100      */
101     public String toString() {
102         return (value >= 0 && value <= 2) ? getStringTable()[value] : String.valueOf(value);
103     }
104 
105     /**
106      * Returns the lowest integer value used by this enumeration value's
107      * enumeration class.
108      *
109      * @return the offset of the lowest enumeration value.
110      */
111     protected int getOffset() {
112         return 0;
113     }
114 }