|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dbunit.dataset.datatype.DataType
org.dbunit.dataset.datatype.AbstractDataType
public abstract class AbstractDataType
Abstract data type implementation that provides generic methods that are
appropriate for most data type implementations. Among those is the
generic implementation of the compare(Object, Object) method.
| Field Summary |
|---|
| Fields inherited from class org.dbunit.dataset.datatype.DataType |
|---|
BIGINT, BIGINT_AUX_LONG, BINARY, BIT, BLOB, BOOLEAN, CHAR, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, LONGNVARCHAR, LONGVARBINARY, LONGVARCHAR, NCHAR, NUMERIC, NVARCHAR, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, UNKNOWN, VARBINARY, VARCHAR |
| Constructor Summary | |
|---|---|
AbstractDataType(java.lang.String name,
int sqlType,
java.lang.Class classType,
boolean isNumber)
|
|
| Method Summary | |
|---|---|
protected boolean |
areObjectsEqual(java.lang.Object o1,
java.lang.Object o2)
Checks whether the given objects are equal or not. |
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. |
protected int |
compareNonNulls(java.lang.Object value1,
java.lang.Object value2)
Compares non-null values to each other. |
int |
getSqlType()
Returns the corresponding Types. |
java.lang.Object |
getSqlValue(int column,
java.sql.ResultSet resultSet)
Returns the specified column value from the specified resultset object. |
java.lang.Class |
getTypeClass()
Returns the runtime class of the typecast result. |
boolean |
isDateTime()
Returns true if this DataType represents a
date and/or time. |
boolean |
isNumber()
Returns true if this DataType represents a
number. |
protected java.lang.Class |
loadClass(java.lang.String clazz,
java.lang.ClassLoader classLoader)
|
protected java.lang.Class |
loadClass(java.lang.String clazz,
java.sql.Connection connection)
|
void |
setSqlValue(java.lang.Object value,
int column,
java.sql.PreparedStatement statement)
Set the specified value to the specified prepared statement object. |
java.lang.String |
toString()
|
| Methods inherited from class org.dbunit.dataset.datatype.DataType |
|---|
asString, forObject, forSqlType, forSqlTypeName, typeCast |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDataType(java.lang.String name,
int sqlType,
java.lang.Class classType,
boolean isNumber)
| Method Detail |
|---|
public int compare(java.lang.Object o1,
java.lang.Object o2)
throws TypeCastException
DataTypeThe two values are typecast to this DataType before being compared.
compare in class DataTypeTypeCastException - if the arguments' types prevent them from
being compared by this Comparator.
protected int compareNonNulls(java.lang.Object value1,
java.lang.Object value2)
throws TypeCastException
Comparable. The two given objects
are the results of the DataType.typeCast(Object) method call which is usually
implemented by a specialized DataType implementation.
value1 - First value resulting from the DataType.typeCast(Object) method callvalue2 - Second value resulting from the DataType.typeCast(Object) method call
Comparable.compareTo(Object) invocation.
TypeCastException
protected final boolean areObjectsEqual(java.lang.Object o1,
java.lang.Object o2)
o1 - first objecto2 - second object
true if both objects are null (and hence equal)
or if the o1.equals(o2) is true.public int getSqlType()
DataTypeTypes.
getSqlType in class DataTypepublic java.lang.Class getTypeClass()
DataType
getTypeClass in class DataTypepublic boolean isNumber()
DataTypetrue if this DataType represents a
number.
isNumber in class DataTypepublic boolean isDateTime()
DataTypetrue if this DataType represents a
date and/or time.
isDateTime in class DataType
public java.lang.Object getSqlValue(int column,
java.sql.ResultSet resultSet)
throws java.sql.SQLException,
TypeCastException
DataType
getSqlValue in class DataTypejava.sql.SQLException
TypeCastException
public void setSqlValue(java.lang.Object value,
int column,
java.sql.PreparedStatement statement)
throws java.sql.SQLException,
TypeCastException
DataType
setSqlValue in class DataTypejava.sql.SQLException
TypeCastException
protected final java.lang.Class loadClass(java.lang.String clazz,
java.sql.Connection connection)
throws java.lang.ClassNotFoundException
clazz - The fully qualified name of the class to be loadedconnection - The JDBC connection needed to load the given class
java.lang.ClassNotFoundException
protected final java.lang.Class loadClass(java.lang.String clazz,
java.lang.ClassLoader classLoader)
throws java.lang.ClassNotFoundException
clazz - The fully qualified name of the class to be loadedclassLoader - The classLoader to be used to load the given class
java.lang.ClassNotFoundExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||