public interface DataType
extends java.util.Comparator, java.io.Serializable
Table
.
Responsible for testing
that a value is assignable to fields of this
type, for converting
Objects
to this type, and for
reading
values from and writing
values to a stream.
Modifier and Type | Interface and Description |
---|---|
static interface |
DataType.BinaryRepresentation
Extension of DataType to indicate that the implementing class stores binary values,
and as such returns precision as the number of bits used to represent a given
value.
|
static interface |
DataType.ExactNumeric
Extension of NonFixedPrecision to indicate that the scale of the implementing class
is not fixed by the implementation, but rather can be declared by the user.
|
static interface |
DataType.NonFixedPrecision
Extension of DataType to indicate that the precision of the implementing class is
not fixed by the implementation, but rather can be declared by the user.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(java.lang.Object value)
Return
true if a field of my type can be assigned the given non-
null value , false otherwise. |
java.lang.Object |
convert(java.lang.Object value)
Converts an
acceptable value to one of the appropriate type. |
int |
getColumnDisplaySize()
Value returned by
ResultSetMetaData#getColumnDisplaySize for this data
type. |
int |
getJdbcType()
Returns the JDBC
type code most closely matching this type. |
java.lang.String |
getLiteralPrefix()
Prefix used to quote a literal to delimit value for this type when in SQL syntax or
result display
|
java.lang.String |
getLiteralSuffix()
Suffix used to quote a literal to delimit value for this type when in SQL syntax or
result display
|
int |
getNullableCode()
Code indicating that type does not accept, does accept, or does not disclose
acceptance of
null values |
int |
getPrecision()
Value returned by
ResultSetMetaData#getPrecision for this data type. |
int |
getPrecisionRadix()
Indicates radix used to compute maximum number of significant digits for this
datatype, as returned by
getPrecision() . |
java.lang.String |
getPreferredValueClassName()
Returns the "normal" type returned by
convert(java.lang.Object) . |
int |
getScale()
Value returned by
ResultSetMetaData#getScale for this data type. |
short |
getSearchableCode()
Code indicating how much
WHERE ... |
boolean |
isCaseSensitive()
For character and string-related types, indicates whether type acknowledges case
when storing and retrieving values
|
boolean |
isCurrency() |
boolean |
isUnsigned()
For numeric types, indicates whether type stores only non-negative (>= 0) values
|
DataType |
makeNewInstance()
Creates a new instance of this DataType implementation.
|
java.lang.Object |
read(java.io.DataInput in)
Instantiate an object of my type from the given
DataInput . |
java.lang.Object |
successor(java.lang.Object value)
Returns the successor for the given value.
|
boolean |
supportsSuccessor()
Returns
true if the successor(java.lang.Object) method is supported, false
otherwise. |
java.math.BigDecimal |
toBigDecimal(java.lang.Object value)
|
java.math.BigInteger |
toBigInteger(java.lang.Object value)
|
java.sql.Blob |
toBlob(java.lang.Object value)
|
boolean |
toBoolean(java.lang.Object value)
Convert the given non-
null value to a boolean ,
or throw a SQLException . |
byte |
toByte(java.lang.Object value)
Convert the given non-
null value to a byte ,
or throw a SQLException . |
byte[] |
toByteArray(java.lang.Object value)
|
java.sql.Clob |
toClob(java.lang.Object value)
|
java.sql.Date |
toDate(java.lang.Object value)
Convert the given non-
null value to a Date ,
or throw a SQLException . |
double |
toDouble(java.lang.Object value)
|
float |
toFloat(java.lang.Object value)
|
int |
toInt(java.lang.Object value)
|
long |
toLong(java.lang.Object value)
|
short |
toShort(java.lang.Object value)
|
java.lang.String |
toString(java.lang.Object value)
|
java.sql.Time |
toTime(java.lang.Object value)
|
java.sql.Timestamp |
toTimestamp(java.lang.Object value)
|
java.net.URL |
toURL(java.lang.Object value)
|
void |
write(java.lang.Object value,
java.io.DataOutput out)
Write an object of my type to the given
DataOutput . |
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
boolean accepts(java.lang.Object value)
true
if a field of my type can be assigned the given non-
null
value , false
otherwise.value
- non- null
valuejava.lang.Object convert(java.lang.Object value) throws AxionException
acceptable
value to one of the appropriate type.AxionException
int getColumnDisplaySize()
ResultSetMetaData#getColumnDisplaySize
for this data
type.ResultSetMetaData.getColumnDisplaySize(int)
int getJdbcType()
type code
most closely matching this type.java.lang.String getLiteralPrefix()
DatabaseMetaData.getTypeInfo()
java.lang.String getLiteralSuffix()
DatabaseMetaData.getTypeInfo()
int getNullableCode()
null
valuesDatabaseMetaData.getTypeInfo()
int getPrecision()
ResultSetMetaData#getPrecision
for this data type.ResultSetMetaData.getPrecision(int)
int getPrecisionRadix()
getPrecision()
.getPrecision()
, typically 2 or 10.java.lang.String getPreferredValueClassName()
convert(java.lang.Object)
. Returns
java.lang.Object if unknown.ResultSetMetaData.getColumnClassName(int)
int getScale()
ResultSetMetaData#getScale
for this data type.ResultSetMetaData.getScale(int)
short getSearchableCode()
WHERE ... LIKE
support is available across
a column of this typeDatabaseMetaData.getTypeInfo()
boolean isCaseSensitive()
DatabaseMetaData.getTypeInfo()
,
ResultSetMetaData.isCaseSensitive(int)
boolean isCurrency()
ResultSetMetaData.isCurrency(int)
boolean isUnsigned()
DatabaseMetaData.getTypeInfo()
java.lang.Object read(java.io.DataInput in) throws java.io.IOException
DataInput
. The next
sequence of bytes to be read from the DataInput
will have been
written by write(java.lang.Object, java.io.DataOutput)
.java.io.IOException
java.lang.Object successor(java.lang.Object value) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
boolean supportsSuccessor()
true
if the successor(java.lang.Object)
method is supported, false
otherwise.java.math.BigDecimal toBigDecimal(java.lang.Object value) throws AxionException
AxionException
ResultSet.getBigDecimal(int, int)
java.math.BigInteger toBigInteger(java.lang.Object value) throws AxionException
AxionException
java.sql.ResultSet#getBigInteger
java.sql.Blob toBlob(java.lang.Object value) throws AxionException
AxionException
ResultSet.getBlob(int)
boolean toBoolean(java.lang.Object value) throws AxionException
null
value to a boolean
,
or throw a SQLException
.AxionException
ResultSet.getBoolean(int)
byte toByte(java.lang.Object value) throws AxionException
null
value to a byte
,
or throw a SQLException
.AxionException
ResultSet.getByte(int)
byte[] toByteArray(java.lang.Object value) throws AxionException
AxionException
ResultSet.getBytes(int)
java.sql.Clob toClob(java.lang.Object value) throws AxionException
AxionException
ResultSet.getClob(int)
java.sql.Date toDate(java.lang.Object value) throws AxionException
null
value to a Date
,
or throw a SQLException
.AxionException
ResultSet.getDate(int)
double toDouble(java.lang.Object value) throws AxionException
AxionException
ResultSet.getDouble(int)
float toFloat(java.lang.Object value) throws AxionException
AxionException
ResultSet.getFloat(int)
int toInt(java.lang.Object value) throws AxionException
AxionException
ResultSet.getInt(int)
long toLong(java.lang.Object value) throws AxionException
AxionException
ResultSet.getLong(int)
short toShort(java.lang.Object value) throws AxionException
AxionException
ResultSet.getShort(int)
java.lang.String toString(java.lang.Object value) throws AxionException
AxionException
ResultSet.getString(int)
java.sql.Time toTime(java.lang.Object value) throws AxionException
AxionException
ResultSet.getTime(int)
java.sql.Timestamp toTimestamp(java.lang.Object value) throws AxionException
AxionException
ResultSet.getTimestamp(int)
java.net.URL toURL(java.lang.Object value) throws AxionException
AxionException
ResultSet.getURL(int)
void write(java.lang.Object value, java.io.DataOutput out) throws java.io.IOException
DataOutput
.value
- the value to write, which must be acceptable
to this
DataType
java.io.IOException
DataType makeNewInstance()