org.apache.ddlutils.model
Class TypeMap

java.lang.Object
  extended by org.apache.ddlutils.model.TypeMap

public abstract class TypeMap
extends java.lang.Object

A class that maps SQL type names to their JDBC type ID found in Types and vice versa.

Version:
$Revision: 463305 $

Field Summary
static java.lang.String ARRAY
          The string representation of the Types.ARRAY constant.
static java.lang.String BIGINT
          The string representation of the Types.BIGINT constant.
static java.lang.String BINARY
          The string representation of the Types.BINARY constant.
static java.lang.String BIT
          The string representation of the Types.BIT constant.
static java.lang.String BLOB
          The string representation of the Types.BLOB constant.
static java.lang.String BOOLEAN
          The string representation of the Types.BOOLEAN constant.
static java.lang.String CHAR
          The string representation of the Types.CHAR constant.
static java.lang.String CLOB
          The string representation of the Types.CLOB constant.
static java.lang.String DATALINK
          The string representation of the Types.DATALINK constant.
static java.lang.String DATE
          The string representation of the Types.DATE constant.
static java.lang.String DECIMAL
          The string representation of the Types.DECIMAL constant.
static java.lang.String DISTINCT
          The string representation of the Types.DISTINCT constant.
static java.lang.String DOUBLE
          The string representation of the Types.DOUBLE constant.
static java.lang.String FLOAT
          The string representation of the Types.FLOAT constant.
static java.lang.String INTEGER
          The string representation of the Types.INTEGER constant.
static java.lang.String JAVA_OBJECT
          The string representation of the Types.JAVA_OBJECT constant.
static java.lang.String LONGVARBINARY
          The string representation of the Types.LONGVARBINARY constant.
static java.lang.String LONGVARCHAR
          The string representation of the Types.LONGVARCHAR constant.
static java.lang.String NULL
          The string representation of the Types.NULL constant.
static java.lang.String NUMERIC
          The string representation of the Types.NUMERIC constant.
static java.lang.String OTHER
          The string representation of the Types.OTHER constant.
static java.lang.String REAL
          The string representation of the Types.REAL constant.
static java.lang.String REF
          The string representation of the Types.REF constant.
static java.lang.String SMALLINT
          The string representation of the Types.SMALLINT constant.
static java.lang.String STRUCT
          The string representation of the Types.STRUCT constant.
static java.lang.String TIME
          The string representation of the Types.TIME constant.
static java.lang.String TIMESTAMP
          The string representation of the Types.TIMESTAMP constant.
static java.lang.String TINYINT
          The string representation of the Types.TINYINT constant.
static java.lang.String VARBINARY
          The string representation of the Types.VARBINARY constant.
static java.lang.String VARCHAR
          The string representation of the Types.VARCHAR constant.
 
Constructor Summary
TypeMap()
           
 
Method Summary
static java.lang.Integer getJdbcTypeCode(java.lang.String typeName)
          Returns the JDBC type code (one of the Types constants) that corresponds to the given JDBC type name.
static java.lang.String getJdbcTypeName(int typeCode)
          Returns the JDBC type name that corresponds to the given type code (one of the Types constants).
static boolean isBinaryType(int jdbcTypeCode)
          Determines whether the given jdbc type (one of the Types constants) is a binary type.
static boolean isDateTimeType(int jdbcTypeCode)
          Determines whether the given jdbc type (one of the Types constants) is a date/time type.
static boolean isNumericType(int jdbcTypeCode)
          Determines whether the given jdbc type (one of the Types constants) is a numeric type.
static boolean isSpecialType(int jdbcTypeCode)
          Determines whether the given sql type (one of the Types constants) is a special type.
static boolean isTextType(int jdbcTypeCode)
          Determines whether the given jdbc type (one of the Types constants) is a text type.
protected static void registerJdbcType(int typeCode, java.lang.String typeName, JdbcTypeCategoryEnum category)
          Registers a jdbc type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARRAY

public static final java.lang.String ARRAY
The string representation of the Types.ARRAY constant.

See Also:
Constant Field Values

BIGINT

public static final java.lang.String BIGINT
The string representation of the Types.BIGINT constant.

See Also:
Constant Field Values

BINARY

public static final java.lang.String BINARY
The string representation of the Types.BINARY constant.

See Also:
Constant Field Values

BIT

public static final java.lang.String BIT
The string representation of the Types.BIT constant.

See Also:
Constant Field Values

BLOB

public static final java.lang.String BLOB
The string representation of the Types.BLOB constant.

See Also:
Constant Field Values

BOOLEAN

public static final java.lang.String BOOLEAN
The string representation of the Types.BOOLEAN constant.

See Also:
Constant Field Values

CHAR

public static final java.lang.String CHAR
The string representation of the Types.CHAR constant.

See Also:
Constant Field Values

CLOB

public static final java.lang.String CLOB
The string representation of the Types.CLOB constant.

See Also:
Constant Field Values

DATALINK

public static final java.lang.String DATALINK
The string representation of the Types.DATALINK constant.

See Also:
Constant Field Values

DATE

public static final java.lang.String DATE
The string representation of the Types.DATE constant.

See Also:
Constant Field Values

DECIMAL

public static final java.lang.String DECIMAL
The string representation of the Types.DECIMAL constant.

See Also:
Constant Field Values

DISTINCT

public static final java.lang.String DISTINCT
The string representation of the Types.DISTINCT constant.

See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
The string representation of the Types.DOUBLE constant.

See Also:
Constant Field Values

FLOAT

public static final java.lang.String FLOAT
The string representation of the Types.FLOAT constant.

See Also:
Constant Field Values

INTEGER

public static final java.lang.String INTEGER
The string representation of the Types.INTEGER constant.

See Also:
Constant Field Values

JAVA_OBJECT

public static final java.lang.String JAVA_OBJECT
The string representation of the Types.JAVA_OBJECT constant.

See Also:
Constant Field Values

LONGVARBINARY

public static final java.lang.String LONGVARBINARY
The string representation of the Types.LONGVARBINARY constant.

See Also:
Constant Field Values

LONGVARCHAR

public static final java.lang.String LONGVARCHAR
The string representation of the Types.LONGVARCHAR constant.

See Also:
Constant Field Values

NULL

public static final java.lang.String NULL
The string representation of the Types.NULL constant.

See Also:
Constant Field Values

NUMERIC

public static final java.lang.String NUMERIC
The string representation of the Types.NUMERIC constant.

See Also:
Constant Field Values

OTHER

public static final java.lang.String OTHER
The string representation of the Types.OTHER constant.

See Also:
Constant Field Values

REAL

public static final java.lang.String REAL
The string representation of the Types.REAL constant.

See Also:
Constant Field Values

REF

public static final java.lang.String REF
The string representation of the Types.REF constant.

See Also:
Constant Field Values

SMALLINT

public static final java.lang.String SMALLINT
The string representation of the Types.SMALLINT constant.

See Also:
Constant Field Values

STRUCT

public static final java.lang.String STRUCT
The string representation of the Types.STRUCT constant.

See Also:
Constant Field Values

TIME

public static final java.lang.String TIME
The string representation of the Types.TIME constant.

See Also:
Constant Field Values

TIMESTAMP

public static final java.lang.String TIMESTAMP
The string representation of the Types.TIMESTAMP constant.

See Also:
Constant Field Values

TINYINT

public static final java.lang.String TINYINT
The string representation of the Types.TINYINT constant.

See Also:
Constant Field Values

VARBINARY

public static final java.lang.String VARBINARY
The string representation of the Types.VARBINARY constant.

See Also:
Constant Field Values

VARCHAR

public static final java.lang.String VARCHAR
The string representation of the Types.VARCHAR constant.

See Also:
Constant Field Values
Constructor Detail

TypeMap

public TypeMap()
Method Detail

getJdbcTypeCode

public static java.lang.Integer getJdbcTypeCode(java.lang.String typeName)
Returns the JDBC type code (one of the Types constants) that corresponds to the given JDBC type name.

Parameters:
typeName - The JDBC type name (case is ignored)
Returns:
The type code or null if the type is unknown

getJdbcTypeName

public static java.lang.String getJdbcTypeName(int typeCode)
Returns the JDBC type name that corresponds to the given type code (one of the Types constants).

Parameters:
typeCode - The type code
Returns:
The JDBC type name (one of the constants in this class) or null if the type is unknown

registerJdbcType

protected static void registerJdbcType(int typeCode,
                                       java.lang.String typeName,
                                       JdbcTypeCategoryEnum category)
Registers a jdbc type.

Parameters:
typeCode - The type code (one of the Types constants)
typeName - The type name (case is ignored)
category - The type category

isNumericType

public static boolean isNumericType(int jdbcTypeCode)
Determines whether the given jdbc type (one of the Types constants) is a numeric type.

Parameters:
jdbcTypeCode - The type code
Returns:
true if the type is a numeric one

isDateTimeType

public static boolean isDateTimeType(int jdbcTypeCode)
Determines whether the given jdbc type (one of the Types constants) is a date/time type.

Parameters:
jdbcTypeCode - The type code
Returns:
true if the type is a numeric one

isTextType

public static boolean isTextType(int jdbcTypeCode)
Determines whether the given jdbc type (one of the Types constants) is a text type.

Parameters:
jdbcTypeCode - The type code
Returns:
true if the type is a text one

isBinaryType

public static boolean isBinaryType(int jdbcTypeCode)
Determines whether the given jdbc type (one of the Types constants) is a binary type.

Parameters:
jdbcTypeCode - The type code
Returns:
true if the type is a binary one

isSpecialType

public static boolean isSpecialType(int jdbcTypeCode)
Determines whether the given sql type (one of the Types constants) is a special type.

Parameters:
jdbcTypeCode - The type code
Returns:
true if the type is a special one


Copyright © 2005-2010 Apache Software Foundation. All Rights Reserved.