|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbunit.dataset.datatype.DataType
public abstract class DataType
Field Summary | |
---|---|
static DataType |
BIGINT
|
static DataType |
BINARY
|
static DataType |
BLOB
|
static DataType |
BOOLEAN
|
static DataType |
CHAR
|
static DataType |
CLOB
|
static DataType |
DATE
|
static DataType |
DECIMAL
|
static DataType |
DOUBLE
|
static DataType |
FLOAT
|
static DataType |
INTEGER
|
static DataType |
LONGVARBINARY
|
static DataType |
LONGVARCHAR
|
static DataType |
NUMERIC
|
static DataType |
REAL
|
static DataType |
SMALLINT
|
static DataType |
TIME
|
static DataType |
TIMESTAMP
|
static DataType |
TINYINT
|
static DataType |
UNKNOWN
|
static DataType |
VARBINARY
|
static DataType |
VARCHAR
|
Constructor Summary | |
---|---|
DataType()
|
Method Summary | |
---|---|
static java.lang.String |
asString(java.lang.Object value)
Typecast the specified value to string. |
abstract int |
compare(java.lang.Object o1,
java.lang.Object o2)
Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. |
static DataType |
forObject(java.lang.Object value)
Returns the DataType corresponding to the specified value
runtime class. |
static DataType |
forSqlType(int sqlType)
Returns the DataType corresponding to the specified Sql
type. |
static DataType |
forSqlTypeName(java.lang.String sqlTypeName)
Deprecated. Should not be used anymore |
abstract int |
getSqlType()
Returns the coresponding Types . |
abstract java.lang.Object |
getSqlValue(int column,
java.sql.ResultSet resultSet)
Returns the specified column value from the specified resultset object. |
abstract java.lang.Class |
getTypeClass()
Returns the runtime class of the typecast result. |
abstract boolean |
isDateTime()
Returns true if this DataType represents a
date and/or time. |
abstract boolean |
isNumber()
Returns true if this DataType represents a
number. |
abstract void |
setSqlValue(java.lang.Object value,
int column,
java.sql.PreparedStatement statement)
Set the specified value to the specified prepared statement object. |
abstract java.lang.Object |
typeCast(java.lang.Object value)
Returns the specified value typecasted to this DataType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DataType UNKNOWN
public static final DataType CHAR
public static final DataType VARCHAR
public static final DataType LONGVARCHAR
public static final DataType CLOB
public static final DataType NUMERIC
public static final DataType DECIMAL
public static final DataType BOOLEAN
public static final DataType TINYINT
public static final DataType SMALLINT
public static final DataType INTEGER
public static final DataType BIGINT
public static final DataType REAL
public static final DataType FLOAT
public static final DataType DOUBLE
public static final DataType DATE
public static final DataType TIME
public static final DataType TIMESTAMP
public static final DataType BINARY
public static final DataType VARBINARY
public static final DataType LONGVARBINARY
public static final DataType BLOB
Constructor Detail |
---|
public DataType()
Method Detail |
---|
public abstract java.lang.Object typeCast(java.lang.Object value) throws TypeCastException
DataType
TypeCastException
public abstract int compare(java.lang.Object o1, java.lang.Object o2) throws TypeCastException
The two values are typecast to this DataType before being compared.
TypeCastException
- if the arguments' types prevent them from
being compared by this Comparator.public abstract int getSqlType()
Types
.
public abstract java.lang.Class getTypeClass()
public abstract boolean isNumber()
true
if this DataType
represents a
number.
public abstract boolean isDateTime()
true
if this DataType
represents a
date and/or time.
public abstract java.lang.Object getSqlValue(int column, java.sql.ResultSet resultSet) throws java.sql.SQLException, TypeCastException
java.sql.SQLException
TypeCastException
public abstract void setSqlValue(java.lang.Object value, int column, java.sql.PreparedStatement statement) throws java.sql.SQLException, TypeCastException
java.sql.SQLException
TypeCastException
public static java.lang.String asString(java.lang.Object value) throws TypeCastException
TypeCastException
public static DataType forSqlType(int sqlType) throws DataTypeException
DataType
corresponding to the specified Sql
type. See Types
.
DataTypeException
public static DataType forSqlTypeName(java.lang.String sqlTypeName) throws DataTypeException
DataType
corresponding to the specified Sql
type name.
DataTypeException
public static DataType forObject(java.lang.Object value)
DataType
corresponding to the specified value
runtime class. This method returns DataType.UNKNOWN
if the value is null
or runtime class not recognized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |