public abstract class ScalarTypeBaseDate<T> extends ScalarTypeBase<T>
jdbcNative, jdbcType, type| Constructor and Description |
|---|
ScalarTypeBaseDate(Class<T> type,
boolean jdbcNative,
int jdbcType) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(DataBind b,
T value)
Convert (if necessary) and bind the value to the preparedStatement.
|
abstract T |
convertFromDate(Date ts) |
abstract Date |
convertToDate(T t) |
String |
formatValue(T t)
Convert the type into a string representation.
|
boolean |
isDateTimeCapable()
Return true if the type can accept long systemTimeMillis input.
|
T |
jsonFromString(String value,
JsonValueAdapter ctx) |
String |
jsonToString(T value,
JsonValueAdapter ctx) |
void |
jsonWrite(WriteJsonBuffer buffer,
T value,
JsonValueAdapter ctx) |
T |
parse(String value)
Convert the string value to the appropriate java object.
|
T |
parseDateTime(long systemTimeMillis)
Convert the systemTimeMillis into the appropriate java object.
|
T |
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical
bean property value.
|
Object |
readData(DataInput dataInput) |
void |
writeData(DataOutput dataOutput,
Object v) |
accumulateScalarTypes, format, getDbNullValue, getJdbcType, getLength, getType, isDbNull, isJdbcNative, loadIgnoreclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoBeanType, toJdbcTypepublic void bind(DataBind b, T value) throws SQLException
ScalarTypevalue may need to be converted from the logical bean property type to the JDBC type.
SQLExceptionpublic T read(DataReader dataReader) throws SQLException
ScalarTypeSQLExceptionpublic String formatValue(T t)
ScalarTypeReciprocal of parse().
public T parse(String value)
ScalarTypeMostly used to support CSV, JSON and XML parsing.
Reciprocal of formatValue().
public T parseDateTime(long systemTimeMillis)
ScalarTypeFor non dateTime types this will throw an exception.
public boolean isDateTimeCapable()
ScalarType
This is used to determine if is is sensible to use the
ScalarType.parseDateTime(long) method.
This includes the Date, Calendar, sql Date, Time, Timestamp, JODA types as well as Long, BigDecimal and String (although it generally is not expected to parse systemTimeMillis to a String or BigDecimal).
public String jsonToString(T value, JsonValueAdapter ctx)
jsonToString in interface ScalarType<T>jsonToString in class ScalarTypeBase<T>public void jsonWrite(WriteJsonBuffer buffer, T value, JsonValueAdapter ctx)
jsonWrite in interface ScalarType<T>jsonWrite in class ScalarTypeBase<T>public T jsonFromString(String value, JsonValueAdapter ctx)
jsonFromString in interface ScalarType<T>jsonFromString in class ScalarTypeBase<T>public Object readData(DataInput dataInput) throws IOException
IOExceptionpublic void writeData(DataOutput dataOutput, Object v) throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.