@HandleClassMetadata @HandleBeanView public abstract class BaseReadableInstantConverter<T extends org.joda.time.ReadableInstant> extends Object implements Converter<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
dateAsMillis |
protected org.joda.time.format.DateTimeFormatter |
formatter |
Modifier | Constructor and Description |
---|---|
protected |
BaseReadableInstantConverter(boolean dateAsMillis,
org.joda.time.format.DateTimeFormatter formatter) |
Modifier and Type | Method and Description |
---|---|
T |
deserialize(ObjectReader reader,
Context ctx) |
protected abstract T |
fromLong(long value) |
protected abstract T |
fromString(String value) |
void |
serialize(org.joda.time.ReadableInstant object,
ObjectWriter writer,
Context ctx) |
protected final boolean dateAsMillis
protected final org.joda.time.format.DateTimeFormatter formatter
protected BaseReadableInstantConverter(boolean dateAsMillis, org.joda.time.format.DateTimeFormatter formatter)
protected abstract T fromLong(long value)
public void serialize(org.joda.time.ReadableInstant object, ObjectWriter writer, Context ctx) throws Exception
serialize
in interface Converter<T extends org.joda.time.ReadableInstant>
serialize
in interface Serializer<T extends org.joda.time.ReadableInstant>
object
- we want to serialize. The object is of type T or a subclass (if this serializer
has been registered for subclasses).writer
- to use to write data to the output stream.ctx
- the current context.JsonBindingException
JsonStreamException
Exception
public T deserialize(ObjectReader reader, Context ctx) throws Exception
deserialize
in interface Converter<T extends org.joda.time.ReadableInstant>
deserialize
in interface Deserializer<T extends org.joda.time.ReadableInstant>
reader
- used to read data from.ctx
- the current context.JsonBindingException
JsonStreamException
Exception
Copyright © 2019. All rights reserved.