org.codehaus.modello.generator.database.type
Class TypeMap
java.lang.Object
org.codehaus.modello.generator.database.model.TypeMap
org.codehaus.modello.generator.database.type.TypeMap
- class TypeMap
- extends TypeMap
This class is a helper class for converting from string values to their
corresponding Types
(Exists only at the moment to overcome some deficiencies in
TypeMap
- Version:
- 1.1 2003/02/05 08:08:37
- Author:
- Tim Anderson
Field Summary |
static java.lang.String[] |
APPROX_NUMERICS
|
static java.lang.String[] |
EXACT_NUMERICS
|
private static java.util.HashMap |
NAME_MAP
A map of names to their corresponding type identifiers |
private static java.util.HashMap |
TYPE_MAP
A map of type identifiers to their names |
static java.lang.String[] |
VARCHARS
|
Fields inherited from class org.codehaus.modello.generator.database.model.TypeMap |
BIGINT, BINARY, BIT, BLOB, BOOLEANCHAR, BOOLEANINT, CHAR, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGVARBINARY, LONGVARCHAR, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, VARBINARY, VARCHAR |
Constructor Summary |
(package private) |
TypeMap()
|
Method Summary |
static java.lang.String |
getName(int type)
Returns the type name for a type identifier |
static java.lang.Integer |
getType(java.lang.String name)
Returns the type identifier for a type name |
static boolean |
isApproxNumeric(java.lang.String name)
|
static boolean |
isExactNumeric(java.lang.String name)
|
private static boolean |
isType(java.lang.String name,
java.lang.String[] types)
|
static boolean |
isVarChar(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VARCHARS
public static final java.lang.String[] VARCHARS
EXACT_NUMERICS
public static final java.lang.String[] EXACT_NUMERICS
APPROX_NUMERICS
public static final java.lang.String[] APPROX_NUMERICS
TYPE_MAP
private static final java.util.HashMap TYPE_MAP
- A map of type identifiers to their names
NAME_MAP
private static final java.util.HashMap NAME_MAP
- A map of names to their corresponding type identifiers
TypeMap
TypeMap()
getType
public static java.lang.Integer getType(java.lang.String name)
- Returns the type identifier for a type name
- Parameters:
name
- the type name
- Returns:
- the type identifier corresponding
name
or
null
if there is no corresponding identifier
i
getName
public static java.lang.String getName(int type)
- Returns the type name for a type identifier
- Parameters:
type
- the type identifier
- Returns:
- the type name corresponding
id
or
null
if there is no corresponding name
i
isVarChar
public static boolean isVarChar(java.lang.String name)
isExactNumeric
public static boolean isExactNumeric(java.lang.String name)
isApproxNumeric
public static boolean isApproxNumeric(java.lang.String name)
isType
private static boolean isType(java.lang.String name,
java.lang.String[] types)