public abstract class ObjectReaderBean<T> extends java.lang.Object implements ObjectReader<T>
| Modifier and Type | Field and Description |
|---|---|
protected JSONReader.AutoTypeBeforeHandler |
autoTypeBeforeHandler |
protected java.util.function.Function |
buildFunction |
protected java.util.function.Supplier<T> |
creator |
protected FieldReader |
extraFieldReader |
protected long |
features |
protected boolean |
hasDefaultValue |
protected java.lang.Class |
objectClass |
protected JSONSchema |
schema |
protected boolean |
serializable |
protected java.lang.String |
typeName |
protected long |
typeNameHash |
HASH_TYPE, VALUE_NAME| Modifier | Constructor and Description |
|---|---|
protected |
ObjectReaderBean(java.lang.Class objectClass,
java.util.function.Supplier<T> creator,
java.lang.String typeName,
long features,
JSONSchema schema,
java.util.function.Function buildFunction) |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptExtra(java.lang.Object object,
java.lang.String fieldName,
java.lang.Object fieldValue,
long features)
Accepts extra field data that is not mapped to any specific field in the object.
|
private JSONException |
auotypeError(JSONReader jsonReader) |
ObjectReader |
checkAutoType(JSONReader jsonReader,
java.lang.Class expectClass,
long features)
Deprecated.
|
ObjectReader |
checkAutoType(JSONReader jsonReader,
long features) |
protected ObjectReader |
checkAutoType0(JSONReader jsonReader,
long features) |
JSONReader.AutoTypeBeforeHandler |
getAutoTypeBeforeHandler() |
java.lang.Class<T> |
getObjectClass()
Gets the class of objects that this ObjectReader can deserialize.
|
protected void |
initDefaultValue(T object) |
protected void |
initStringFieldAsEmpty(java.lang.Object object) |
private JSONException |
notMatchError() |
protected void |
processExtra(JSONReader jsonReader,
java.lang.Object object) |
protected void |
processExtra(JSONReader jsonReader,
java.lang.Object object,
long features) |
protected T |
processObjectInputSingleItemArray(JSONReader jsonReader,
java.lang.reflect.Type fieldType,
java.lang.Object fieldName,
long features) |
protected boolean |
readFieldValueWithLCase(JSONReader jsonReader,
java.lang.Object object,
long hashCode64,
long features2) |
void |
readObject(JSONReader jsonReader,
java.lang.Object object,
long features) |
T |
readObject(JSONReader jsonReader,
java.lang.reflect.Type fieldType,
java.lang.Object fieldName,
long features)
Reads an object from the specified JSONReader with the given field type, field name, and features.
|
void |
setAutoTypeBeforeHandler(JSONReader.AutoTypeBeforeHandler autoTypeBeforeHandler) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, acceptExtra, autoType, autoType, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstanceNoneDefaultConstructor, getBuildFunction, getFeatures, getFieldReader, getFieldReader, getFieldReaderLCase, getTypeKey, getTypeKeyHash, readArrayMappingJSONBObject, readArrayMappingObject, readJSONBObject, readObject, readObject, readObject, setFieldValue, setFieldValue, setFieldValueprotected final java.lang.Class objectClass
protected final java.util.function.Supplier<T> creator
protected final java.util.function.Function buildFunction
protected final long features
protected final java.lang.String typeName
protected final long typeNameHash
protected FieldReader extraFieldReader
protected boolean hasDefaultValue
protected final boolean serializable
protected final JSONSchema schema
protected JSONReader.AutoTypeBeforeHandler autoTypeBeforeHandler
protected ObjectReaderBean(java.lang.Class objectClass,
java.util.function.Supplier<T> creator,
java.lang.String typeName,
long features,
JSONSchema schema,
java.util.function.Function buildFunction)
public java.lang.Class<T> getObjectClass()
ObjectReadergetObjectClass in interface ObjectReader<T>protected T processObjectInputSingleItemArray(JSONReader jsonReader, java.lang.reflect.Type fieldType, java.lang.Object fieldName, long features)
protected void processExtra(JSONReader jsonReader, java.lang.Object object)
protected void processExtra(JSONReader jsonReader, java.lang.Object object, long features)
public void acceptExtra(java.lang.Object object,
java.lang.String fieldName,
java.lang.Object fieldValue,
long features)
ObjectReaderacceptExtra in interface ObjectReader<T>object - the object being deserializedfieldName - the name of the extra fieldfieldValue - the value of the extra fieldfeatures - the JSON reader features to use@Deprecated public final ObjectReader checkAutoType(JSONReader jsonReader, java.lang.Class expectClass, long features)
public final ObjectReader checkAutoType(JSONReader jsonReader, long features)
protected final ObjectReader checkAutoType0(JSONReader jsonReader, long features)
private JSONException notMatchError()
private JSONException auotypeError(JSONReader jsonReader)
protected void initDefaultValue(T object)
public void readObject(JSONReader jsonReader, java.lang.Object object, long features)
public T readObject(JSONReader jsonReader, java.lang.reflect.Type fieldType, java.lang.Object fieldName, long features)
ObjectReaderreadObject in interface ObjectReader<T>jsonReader - the JSONReader to use for parsingfieldType - the type of the field being readfieldName - the name of the field being readfeatures - the features to useprotected void initStringFieldAsEmpty(java.lang.Object object)
public JSONReader.AutoTypeBeforeHandler getAutoTypeBeforeHandler()
public void setAutoTypeBeforeHandler(JSONReader.AutoTypeBeforeHandler autoTypeBeforeHandler)
protected boolean readFieldValueWithLCase(JSONReader jsonReader, java.lang.Object object, long hashCode64, long features2)