Dresden OCL Toolkit

tudresden.ocl.sql
Class TypeManager

java.lang.Object
  extended bytudresden.ocl.sql.TypeManager

public class TypeManager
extends Object

This class maps a number of commonly used datatypes to something like standard SQL datatypes. It is used to reduce the number of possible datatypes used in softwaredesign to a defined Set of datatypes every implementation of SQLBuilder should know.

Author:
Andrea Kling
See Also:
SQLBuilder

Field Summary
static String BIT_1
           
static String CHAR
           
static String DATE
           
static String DOUBLE
           
static String FLOAT
           
static String ID
           
static String INTEGER
           
private  List l
           
static String LONG
           
private static TypeManager myInstance
           
static String SMALLINT
           
static String TIMESTAMP
           
private  Hashtable types
           
static String VARCHAR
           
 
Constructor Summary
private TypeManager()
           
 
Method Summary
static TypeManager getInstance()
           
 String getSQLType(String type)
          maps the datatype given to one of the datatypes given in the static fields.
 List getTypes()
          returns a list of all defined datatypes.
 boolean isDefined(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myInstance

private static TypeManager myInstance

types

private Hashtable types

l

private List l

INTEGER

public static final String INTEGER
See Also:
Constant Field Values

SMALLINT

public static final String SMALLINT
See Also:
Constant Field Values

BIT_1

public static final String BIT_1
See Also:
Constant Field Values

LONG

public static final String LONG
See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

CHAR

public static final String CHAR
See Also:
Constant Field Values

VARCHAR

public static final String VARCHAR
See Also:
Constant Field Values

FLOAT

public static final String FLOAT
See Also:
Constant Field Values

DOUBLE

public static final String DOUBLE
See Also:
Constant Field Values

DATE

public static final String DATE
See Also:
Constant Field Values

TIMESTAMP

public static final String TIMESTAMP
See Also:
Constant Field Values
Constructor Detail

TypeManager

private TypeManager()
Method Detail

getInstance

public static TypeManager getInstance()

getSQLType

public String getSQLType(String type)
maps the datatype given to one of the datatypes given in the static fields. If no matching datatype can be found the type is returned


getTypes

public List getTypes()
returns a list of all defined datatypes. oOly one instance of every Type is contained, meaning as 'integer' is contained in the List 'int' is not.

Returns:
a List of String

isDefined

public boolean isDefined(String type)
Returns:
true if type can be mapped to a standard datatype

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.