public abstract static class ScalarTypeEnumStandard.EnumBase extends ScalarTypeBase
| Modifier and Type | Field and Description |
|---|---|
protected Class |
enumType |
jdbcNative, jdbcType, type| Constructor and Description |
|---|
ScalarTypeEnumStandard.EnumBase(Class<?> type,
boolean jdbcNative,
int jdbcType) |
| Modifier and Type | Method and Description |
|---|---|
String |
format(Object t)
Convert the type into a string representation.
|
String |
formatValue(Object t)
Convert the type into a string representation.
|
boolean |
isDateTimeCapable()
Return true if the type can accept long systemTimeMillis input.
|
Object |
jsonFromString(String value,
JsonValueAdapter ctx) |
String |
jsonToString(Object value,
JsonValueAdapter ctx) |
Object |
parse(String value)
Convert the string value to the appropriate java object.
|
Object |
parseDateTime(long systemTimeMillis)
Convert the systemTimeMillis into the appropriate java object.
|
Object |
readData(DataInput dataInput) |
void |
writeData(DataOutput dataOutput,
Object v) |
accumulateScalarTypes, getDbNullValue, getJdbcType, getLength, getType, isDbNull, isJdbcNative, jsonWrite, loadIgnoreclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbind, read, toBeanType, toJdbcTypeprotected final Class enumType
public ScalarTypeEnumStandard.EnumBase(Class<?> type, boolean jdbcNative, int jdbcType)
public String format(Object t)
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 ScalarTypeformat in class ScalarTypeBasepublic String formatValue(Object t)
ScalarTypeReciprocal of parse().
public Object parse(String value)
ScalarTypeMostly used to support CSV, JSON and XML parsing.
Reciprocal of formatValue().
public Object 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 Object jsonFromString(String value, JsonValueAdapter ctx)
jsonFromString in interface ScalarTypejsonFromString in class ScalarTypeBasepublic String jsonToString(Object value, JsonValueAdapter ctx)
jsonToString in interface ScalarTypejsonToString in class ScalarTypeBasepublic Object readData(DataInput dataInput) throws IOException
IOExceptionpublic void writeData(DataOutput dataOutput, Object v) throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.