public abstract class ScalarTypeBase<T> extends Object implements ScalarType<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
jdbcNative |
protected int |
jdbcType |
protected Class<T> |
type |
| Constructor and Description |
|---|
ScalarTypeBase(Class<T> type,
boolean jdbcNative,
int jdbcType) |
| Modifier and Type | Method and Description |
|---|---|
void |
accumulateScalarTypes(String propName,
CtCompoundTypeScalarList list)
Accumulate all the scalar types used by an immutable compound value type.
|
String |
format(Object v)
Convert the type into a string representation.
|
Object |
getDbNullValue(Object value)
Returns the value that was passed in.
|
int |
getJdbcType()
Return the type as per java.sql.Types that this maps to.
|
int |
getLength()
Just return 0.
|
Class<T> |
getType()
Return the type that matches the bean property type.
|
boolean |
isDbNull(Object value)
Return true if the value is null.
|
boolean |
isJdbcNative()
Return true if the type is native to JDBC.
|
T |
jsonFromString(String value,
JsonValueAdapter ctx) |
String |
jsonToString(T value,
JsonValueAdapter ctx) |
void |
jsonWrite(WriteJsonBuffer buffer,
T value,
JsonValueAdapter ctx) |
void |
loadIgnore(DataReader dataReader)
Ignore the reading of this value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbind, formatValue, isDateTimeCapable, parse, parseDateTime, read, readData, toBeanType, toJdbcType, writeDatapublic int getLength()
getLength in interface ScalarType<T>public boolean isJdbcNative()
ScalarTypeIf it is native to JDBC then its values/instances do not need to be converted to and from an associated JDBC type.
isJdbcNative in interface ScalarType<T>public int getJdbcType()
ScalarTypeThis type should be consistent with the toJdbcType() method in converting the type to the appropriate type for binding to preparedStatements.
getJdbcType in interface ScalarType<T>public Class<T> getType()
ScalarTypeThis represents the 'logical' type rather than the JDBC type this maps to.
getType in interface ScalarType<T>public String format(Object v)
ScalarTypeThis assumes the value is of the correct type.
This is so that ScalarType also implements the StringFormatter interface.
format in interface StringFormatterformat in interface ScalarType<T>public boolean isDbNull(Object value)
public void loadIgnore(DataReader dataReader)
ScalarTypeloadIgnore in interface ScalarDataReader<T>loadIgnore in interface ScalarType<T>public void accumulateScalarTypes(String propName, CtCompoundTypeScalarList list)
ScalarDataReaderaccumulateScalarTypes in interface ScalarDataReader<T>public void jsonWrite(WriteJsonBuffer buffer, T value, JsonValueAdapter ctx)
jsonWrite in interface ScalarType<T>public String jsonToString(T value, JsonValueAdapter ctx)
jsonToString in interface ScalarType<T>public T jsonFromString(String value, JsonValueAdapter ctx)
jsonFromString in interface ScalarType<T>Copyright © 2014. All Rights Reserved.