Package io.ebeaninternal.server.type
Class ScalarTypeEnumStandard.EnumBase
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase
-
- io.ebeaninternal.server.type.ScalarTypeEnumStandard.EnumBase
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader
,ScalarType
- Direct Known Subclasses:
ScalarTypeEnumStandard.OrdinalEnum
,ScalarTypeEnumStandard.StringEnum
,ScalarTypeEnumWithMapping
- Enclosing class:
- ScalarTypeEnumStandard
public abstract static class ScalarTypeEnumStandard.EnumBase extends ScalarTypeBase
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convertFromMillis(long systemTimeMillis)
Convert the systemTimeMillis into the appropriate java object.String
format(Object value)
Convert the type into a string representation.String
formatValue(Object value)
Convert the type into a string representation.DocPropertyType
getDocType()
Return the type this maps to for JSON document stores.boolean
isDateTimeCapable()
Return true if the type can accept long systemTimeMillis input.Object
jsonRead(com.fasterxml.jackson.core.JsonParser parser)
Read the value from JsonParser.void
jsonWrite(com.fasterxml.jackson.core.JsonGenerator writer, Object value)
Write the value to the JsonGenerator.Object
parse(String value)
Convert the string value to the appropriate java object.Object
readData(DataInput dataInput)
Read the value from binary input.void
writeData(DataOutput dataOutput, Object value)
Write the value to binary output.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ebeaninternal.server.type.ScalarType
bind, read, toBeanType, toJdbcType
-
-
-
-
Method Detail
-
format
public String format(Object value)
Description copied from interface:ScalarType
Convert the type into a string representation.This assumes the value is of the correct type.
This is so that ScalarType also implements the StringFormatter interface.
- Specified by:
format
in interfaceScalarType
- Specified by:
format
in interfaceStringFormatter
- Overrides:
format
in classScalarTypeBase
-
formatValue
public String formatValue(Object value)
Description copied from interface:ScalarType
Convert the type into a string representation.Reciprocal of parse().
-
parse
public Object parse(String value)
Description copied from interface:ScalarType
Convert the string value to the appropriate java object.Mostly used to support CSV, JSON and XML parsing.
Reciprocal of formatValue().
-
convertFromMillis
public Object convertFromMillis(long systemTimeMillis)
Description copied from interface:ScalarType
Convert the systemTimeMillis into the appropriate java object.For non dateTime types this will throw an exception.
-
isDateTimeCapable
public boolean isDateTimeCapable()
Description copied from interface:ScalarType
Return true if the type can accept long systemTimeMillis input.This is used to determine if is is sensible to use the
ScalarType.convertFromMillis(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).
-
jsonRead
public Object jsonRead(com.fasterxml.jackson.core.JsonParser parser) throws IOException
Description copied from interface:ScalarType
Read the value from JsonParser.- Throws:
IOException
-
jsonWrite
public void jsonWrite(com.fasterxml.jackson.core.JsonGenerator writer, Object value) throws IOException
Description copied from interface:ScalarType
Write the value to the JsonGenerator.- Throws:
IOException
-
getDocType
public DocPropertyType getDocType()
Description copied from interface:ScalarType
Return the type this maps to for JSON document stores.
-
readData
public Object readData(DataInput dataInput) throws IOException
Description copied from interface:ScalarType
Read the value from binary input.- Throws:
IOException
-
writeData
public void writeData(DataOutput dataOutput, Object value) throws IOException
Description copied from interface:ScalarType
Write the value to binary output.- Throws:
IOException
-
-