public class AnyType extends BaseDataType
DataType, for use by BindVariable.DataType.BinaryRepresentation, DataType.ExactNumeric, DataType.NonFixedPrecision| Constructor and Description |
|---|
AnyType() |
| 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
acceptablevalue to one of the appropriate type. |
int |
getColumnDisplaySize()
Value returned by
ResultSetMetaData#getColumnDisplaySizefor this data
type. |
int |
getJdbcType()
Returns the JDBC
type codemost closely matching this type. |
java.lang.String |
getPreferredValueClassName()
Returns the "normal" type returned by
DataType.convert(java.lang.Object). |
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 DataType.successor(java.lang.Object)method is supported, false
otherwise. |
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)
|
protected java.lang.Number |
toNumber(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)
|
void |
write(java.lang.Object value,
java.io.DataOutput out)
Write an object of my type to the given
DataOutput. |
compare, getComparator, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getPrecisionRadix, getScale, getSearchableCode, isCaseSensitive, isCurrency, isUnsigned, toBigDecimal, toBigInteger, toURLpublic static final AnyType INSTANCE
public DataType makeNewInstance()
DataTypemakeNewInstance in interface DataTypemakeNewInstance in interface DataTypeFactorymakeNewInstance in class BaseDataTypepublic boolean accepts(java.lang.Object value)
DataTypetrue if a field of my type can be assigned the given non-
null value , false otherwise.accepts in interface DataTypeaccepts in class BaseDataTypevalue - non- null valuepublic java.lang.Object convert(java.lang.Object value)
DataTypeacceptablevalue to one of the appropriate type.convert in interface DataTypeconvert in class BaseDataTypepublic java.lang.Object read(java.io.DataInput in)
throws java.io.IOException
DataTypeDataInput. The next
sequence of bytes to be read from the DataInput will have been
written by DataType.write(java.lang.Object, java.io.DataOutput).read in interface DataTyperead in class BaseDataTypejava.io.IOExceptionpublic void write(java.lang.Object value,
java.io.DataOutput out)
throws java.io.IOException
DataTypeDataOutput.write in interface DataTypewrite in class BaseDataTypevalue - the value to write, which must be acceptableto this
DataTypejava.io.IOExceptionpublic int getColumnDisplaySize()
DataTypeResultSetMetaData#getColumnDisplaySizefor this data
type.getColumnDisplaySize in interface DataTypegetColumnDisplaySize in class BaseDataTypeResultSetMetaData.getColumnDisplaySize(int)public int getJdbcType()
DataTypetype codemost closely matching this type.getJdbcType in interface DataTypegetJdbcType in class BaseDataTypepublic java.lang.String getPreferredValueClassName()
DataTypeDataType.convert(java.lang.Object). Returns
java.lang.Object if unknown.getPreferredValueClassName in interface DataTypegetPreferredValueClassName in class BaseDataTypeAxionResultSetMetaData.getColumnClassName(int)public boolean supportsSuccessor()
DataTypetrue if the DataType.successor(java.lang.Object)method is supported, false
otherwise.supportsSuccessor in interface DataTypesupportsSuccessor in class BaseDataTypepublic java.lang.Object successor(java.lang.Object value)
throws java.lang.IllegalArgumentException
DataTypesuccessor in interface DataTypesuccessor in class BaseDataTypejava.lang.IllegalArgumentExceptionprotected java.lang.Number toNumber(java.lang.Object value)
throws AxionException
toNumber in class BaseDataTypeAxionExceptionpublic boolean toBoolean(java.lang.Object value)
throws AxionException
DataTypenull value to a boolean,
or throw a SQLException.toBoolean in interface DataTypetoBoolean in class BaseDataTypeAxionExceptionResultSet.getBoolean(int)public byte toByte(java.lang.Object value)
throws AxionException
DataTypenull value to a byte,
or throw a SQLException.toByte in interface DataTypetoByte in class BaseDataTypeAxionExceptionResultSet.getByte(int)public byte[] toByteArray(java.lang.Object value)
throws AxionException
DataTypetoByteArray in interface DataTypetoByteArray in class BaseDataTypeAxionExceptionResultSet.getBytes(int)public double toDouble(java.lang.Object value)
throws AxionException
DataTypetoDouble in interface DataTypetoDouble in class BaseDataTypeAxionExceptionResultSet.getDouble(int)public float toFloat(java.lang.Object value)
throws AxionException
DataTypetoFloat in interface DataTypetoFloat in class BaseDataTypeAxionExceptionResultSet.getFloat(int)public int toInt(java.lang.Object value)
throws AxionException
DataTypetoInt in interface DataTypetoInt in class BaseDataTypeAxionExceptionResultSet.getInt(int)public long toLong(java.lang.Object value)
throws AxionException
DataTypetoLong in interface DataTypetoLong in class BaseDataTypeAxionExceptionResultSet.getLong(int)public short toShort(java.lang.Object value)
throws AxionException
DataTypetoShort in interface DataTypetoShort in class BaseDataTypeAxionExceptionResultSet.getShort(int)public java.lang.String toString(java.lang.Object value)
throws AxionException
DataTypetoString in interface DataTypetoString in class BaseDataTypeAxionExceptionResultSet.getString(int)public java.sql.Date toDate(java.lang.Object value)
throws AxionException
DataTypenull value to a Date,
or throw a SQLException.toDate in interface DataTypetoDate in class BaseDataTypeAxionExceptionResultSet.getDate(int)public java.sql.Time toTime(java.lang.Object value)
throws AxionException
DataTypetoTime in interface DataTypetoTime in class BaseDataTypeAxionExceptionResultSet.getTime(int)public java.sql.Timestamp toTimestamp(java.lang.Object value)
throws AxionException
DataTypetoTimestamp in interface DataTypetoTimestamp in class BaseDataTypeAxionExceptionResultSet.getTimestamp(int)public java.sql.Clob toClob(java.lang.Object value)
throws AxionException
DataTypetoClob in interface DataTypetoClob in class BaseDataTypeAxionExceptionResultSet.getClob(int)public java.sql.Blob toBlob(java.lang.Object value)
throws AxionException
DataTypetoBlob in interface DataTypetoBlob in class BaseDataTypeAxionExceptionResultSet.getBlob(int)