|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DConfigBeanVersionType.java | - | 75% | 57,1% | 68,4% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* EJTools, the Enterprise Java Tools
|
|
| 3 |
*
|
|
| 4 |
* Distributable under LGPL license.
|
|
| 5 |
* See terms of license at www.gnu.org.
|
|
| 6 |
*/
|
|
| 7 |
package javax.enterprise.deploy.shared;
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
/**
|
|
| 11 |
* Class DConfigBeanVersionTypes defines enumeration values for the J2EE Platform
|
|
| 12 |
* verion number.
|
|
| 13 |
*
|
|
| 14 |
* @author Laurent Etiemble
|
|
| 15 |
* @version $Revision: 1.1 $
|
|
| 16 |
* @since 1.0
|
|
| 17 |
*/
|
|
| 18 |
public class DConfigBeanVersionType |
|
| 19 |
{
|
|
| 20 |
/** Index value */
|
|
| 21 |
private int value; |
|
| 22 |
|
|
| 23 |
/** J2EE Platform version 1.3 */
|
|
| 24 |
public final static DConfigBeanVersionType V1_3; |
|
| 25 |
/** J2EE Platform version 1.3.1 THIS CONSTANT SHOULD NEVER BE USED. */
|
|
| 26 |
public final static DConfigBeanVersionType V1_3_1; |
|
| 27 |
/** J2EE Platform version 1.4 */
|
|
| 28 |
public final static DConfigBeanVersionType V1_4; |
|
| 29 |
|
|
| 30 |
/** Internal table for string values */
|
|
| 31 |
private final static String[] stringTable; |
|
| 32 |
/** Internal table for values */
|
|
| 33 |
private final static DConfigBeanVersionType[] valueTable; |
|
| 34 |
|
|
| 35 |
|
|
| 36 |
/**
|
|
| 37 |
* Construct a new enumeration value with the given integer value.
|
|
| 38 |
*
|
|
| 39 |
* @param value Integer value.
|
|
| 40 |
*/
|
|
| 41 | 24 |
protected DConfigBeanVersionType(int value) |
| 42 |
{
|
|
| 43 | 24 |
this.value = value;
|
| 44 |
} |
|
| 45 |
|
|
| 46 |
|
|
| 47 |
/**
|
|
| 48 |
* Returns this enumeration value's integer value.
|
|
| 49 |
*
|
|
| 50 |
* @return the value
|
|
| 51 |
*/
|
|
| 52 | 24 |
public int getValue() |
| 53 |
{
|
|
| 54 | 24 |
return this.value; |
| 55 |
} |
|
| 56 |
|
|
| 57 |
|
|
| 58 |
/**
|
|
| 59 |
* Return the string name of this DConfigBeanVersionType or the integer value
|
|
| 60 |
* if outside the bounds of the table.
|
|
| 61 |
*
|
|
| 62 |
* @return The String representation
|
|
| 63 |
*/
|
|
| 64 | 24 |
public String toString()
|
| 65 |
{
|
|
| 66 | 24 |
return stringTable[value];
|
| 67 |
} |
|
| 68 |
|
|
| 69 |
|
|
| 70 |
/**
|
|
| 71 |
* Returns the enumeration value table for class DConfigBeanVersionType
|
|
| 72 |
*
|
|
| 73 |
* @return Enumeration table of the values
|
|
| 74 |
*/
|
|
| 75 | 0 |
protected DConfigBeanVersionType[] getEnumValueTable()
|
| 76 |
{
|
|
| 77 | 0 |
return valueTable;
|
| 78 |
} |
|
| 79 |
|
|
| 80 |
|
|
| 81 |
/**
|
|
| 82 |
* Returns the lowest integer value used by this enumeration value's enumeration
|
|
| 83 |
* class. <p>
|
|
| 84 |
*
|
|
| 85 |
* The default implementation returns 0.</p>
|
|
| 86 |
*
|
|
| 87 |
* @return the offset of the lowest enumeration value.
|
|
| 88 |
*/
|
|
| 89 | 0 |
protected int getOffset() |
| 90 |
{
|
|
| 91 | 0 |
return 0;
|
| 92 |
} |
|
| 93 |
|
|
| 94 |
|
|
| 95 |
/**
|
|
| 96 |
* Returns the string table for class DConfigBeanVersionType
|
|
| 97 |
*
|
|
| 98 |
* @return The String representation table values
|
|
| 99 |
*/
|
|
| 100 | 0 |
protected String[] getStringTable()
|
| 101 |
{
|
|
| 102 | 0 |
return stringTable;
|
| 103 |
} |
|
| 104 |
|
|
| 105 |
|
|
| 106 |
/**
|
|
| 107 |
* Return an object of the specified value.
|
|
| 108 |
*
|
|
| 109 |
* @param value a designator for the object.
|
|
| 110 |
* @return The corresponding DConfigBeanVersionType
|
|
| 111 |
*/
|
|
| 112 | 24 |
public static DConfigBeanVersionType getDConfigBeanVersionType(int value) |
| 113 |
{
|
|
| 114 | 24 |
return valueTable[value];
|
| 115 |
} |
|
| 116 |
|
|
| 117 |
/** Static block to initialize constants and to fill arrays. */
|
|
| 118 |
static
|
|
| 119 |
{
|
|
| 120 | 8 |
V1_3 = new DConfigBeanVersionType(0);
|
| 121 | 8 |
V1_3_1 = new DConfigBeanVersionType(1);
|
| 122 | 8 |
V1_4 = new DConfigBeanVersionType(2);
|
| 123 | 8 |
valueTable = (new DConfigBeanVersionType[]{V1_3, V1_3_1, V1_4});
|
| 124 | 8 |
stringTable = new String[]{"V1_3", "V1_3_1", "V1_4"}; |
| 125 |
} |
|
| 126 |
} |
|
| 127 |
|
|
||||||||||