public abstract class AbstractTemporalFactory<T extends TemporalAccessor> extends Object implements JsonReader.ClassFactory
All custom writers for json-io subclass this class. Special writers are not needed for handling user-defined classes. However, special writers are built/supplied by json-io for many of the primitive types and other JDK classes simply to allow for a more concise form.
| Modifier and Type | Field and Description |
|---|---|
protected DateTimeFormatter |
dateTimeFormatter |
protected ZoneId |
zoneId |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTemporalFactory(DateTimeFormatter dateFormatter,
ZoneId zoneId) |
| Modifier and Type | Method and Description |
|---|---|
protected ZonedDateTime |
convertToZonedDateTime(String s) |
protected abstract T |
fromJsonObject(JsonObject job,
ReaderContext context) |
protected T |
fromNumber(Number l) |
protected abstract T |
fromString(String s) |
boolean |
isObjectFinal() |
T |
newInstance(Class<?> c,
JsonObject jObj,
ReaderContext context)
Implement this method to return a new instance of the passed in Class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgatherRemainingValues, newInstanceprotected final DateTimeFormatter dateTimeFormatter
protected final ZoneId zoneId
protected AbstractTemporalFactory(DateTimeFormatter dateFormatter, ZoneId zoneId)
public T newInstance(Class<?> c, JsonObject jObj, ReaderContext context)
JsonReader.ClassFactorynewInstance in interface JsonReader.ClassFactoryc - Class of the object that needs to be createdjObj - JsonObject (if primitive type do jObj.getPrimitiveValue();context - ReaderContext for creating objects an getting read optionsprotected ZonedDateTime convertToZonedDateTime(String s)
protected abstract T fromJsonObject(JsonObject job, ReaderContext context)
public boolean isObjectFinal()
isObjectFinal in interface JsonReader.ClassFactoryCopyright © 2023. All rights reserved.