public class Jdk8DateCodec extends ContextObjectDeserializer implements ObjectSerializer, ContextObjectSerializer, ObjectDeserializer
| Modifier and Type | Field and Description |
|---|---|
static Jdk8DateCodec |
instance |
| Constructor and Description |
|---|
Jdk8DateCodec() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
castToLocalDateTime(Object value,
String format) |
<T> T |
deserialze(DefaultJSONParser parser,
Type type,
Object fieldName,
String format,
int feature) |
int |
getFastMatchToken() |
protected LocalDateTime |
parseDateTime(String text,
DateTimeFormatter formatter) |
protected LocalDate |
parseLocalDate(String text,
String format,
DateTimeFormatter formatter) |
protected ZonedDateTime |
parseZonedDateTime(String text,
DateTimeFormatter formatter) |
void |
write(JSONSerializer serializer,
Object object,
BeanContext context) |
void |
write(JSONSerializer serializer,
Object object,
Object fieldName,
Type fieldType,
int features)
fastjson invokes this call-back method during serialization when it encounters a field of the
specified type.
|
deserialzeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserialzepublic static final Jdk8DateCodec instance
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName, String format, int feature)
deserialze in class ContextObjectDeserializerprotected LocalDateTime parseDateTime(String text, DateTimeFormatter formatter)
protected LocalDate parseLocalDate(String text, String format, DateTimeFormatter formatter)
protected ZonedDateTime parseZonedDateTime(String text, DateTimeFormatter formatter)
public int getFastMatchToken()
getFastMatchToken in interface ObjectDeserializerpublic void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException
ObjectSerializerwrite in interface ObjectSerializerobject - src the object that needs to be converted to Json.fieldName - parent object field namefieldType - parent object field typefeatures - parent object field serializer featuresIOExceptionpublic void write(JSONSerializer serializer, Object object, BeanContext context) throws IOException
write in interface ContextObjectSerializerIOExceptionCopyright © 2023. All rights reserved.