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 |
Modifier | Constructor and Description |
---|---|
protected |
AbstractTemporalFactory(DateTimeFormatter dateFormatter) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
fromJsonObject(JsonObject job) |
protected T |
fromNumber(Number l) |
protected abstract T |
fromString(String s) |
boolean |
isObjectFinal() |
T |
newInstance(Class<?> c,
JsonObject jObj)
Implement this method to return a new instance of the passed in Class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
gatherRemainingValues
protected final DateTimeFormatter dateTimeFormatter
protected AbstractTemporalFactory(DateTimeFormatter dateFormatter)
public T newInstance(Class<?> c, JsonObject jObj)
JsonReader.ClassFactory
newInstance
in interface JsonReader.ClassFactory
c
- Class of the object that needs to be createdjObj
- JsonObject (if primitive type do jObj.getPrimitiveValue();protected abstract T fromJsonObject(JsonObject job)
public boolean isObjectFinal()
isObjectFinal
in interface JsonReader.ClassFactory
Copyright © 2023. All rights reserved.