public abstract class Resolver extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Resolver.Missingfields
stores missing fields information to notify client after the complete deserialization resolution
|
Modifier and Type | Field and Description |
---|---|
protected Collection<Resolver.Missingfields> |
missingFields |
Modifier | Constructor and Description |
---|---|
protected |
Resolver(ReadOptions readOptions,
ReferenceTracker references) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup() |
protected Object |
coerceCertainTypes(String type) |
protected <T> T |
convertMapsToObjects(JsonObject root)
Walk a JsonObject (Map of String keys to values) and return the
Java object equivalent filled in as best as possible (everything
except unresolved reference fields or unresolved array/collection elements).
|
protected static void |
convertMapToKeysItems(JsonObject map)
Convert an input JsonObject map (known to represent a Map.class or derivative) that has regular keys and values
to have its keys placed into @keys, and its values placed into @items.
|
protected Object |
createInstance(Class clazz,
JsonObject jsonObj)
This method creates a Java Object instance based on the passed in parameters.
|
protected Object |
createInstanceUsingClass(Class clazz,
JsonObject jsonObj)
Create an instance using the Class (clazz) provided and the values in the jsonObj.
|
protected Object |
createInstanceUsingType(JsonObject jsonObj)
Create an instance of a Java class using the ".type" field on the jsonObj.
|
protected EnumSet<?> |
extractEnumSet(Class c,
JsonObject jsonObj) |
protected JsonReader.JsonClassReader |
getCustomReader(Class c) |
protected JsonReader |
getReader()
Deprecated.
|
protected void |
patchUnresolvedReferences()
For all fields where the value was "@ref":"n" where 'n' was the id of an object
that had not yet been encountered in the stream, make the final substitution.
|
protected abstract Object |
readWithFactoryIfExists(Object o,
Class compType,
Deque<JsonObject> stack) |
protected void |
rehashMaps()
Process Maps/Sets (fix up their internal indexing structure)
This is required because Maps hash items using hashCode(), which will
change between VMs.
|
protected abstract void |
traverseArray(Deque<JsonObject> stack,
JsonObject jsonObj) |
protected abstract void |
traverseCollection(Deque<JsonObject> stack,
JsonObject jsonObj) |
abstract void |
traverseFields(Deque<JsonObject> stack,
JsonObject jsonObj) |
abstract void |
traverseFields(Deque<JsonObject> stack,
JsonObject jsonObj,
Set<String> excludeFields) |
protected void |
traverseMap(Deque<JsonObject> stack,
JsonObject jsonObj)
Process java.util.Map and it's derivatives.
|
protected final Collection<Resolver.Missingfields> missingFields
protected Resolver(ReadOptions readOptions, ReferenceTracker references)
@Deprecated protected JsonReader getReader()
protected <T> T convertMapsToObjects(JsonObject root)
root
- JsonObject reference to a Map-of-Maps representation of the JSON
input after it has been completely read.protected abstract Object readWithFactoryIfExists(Object o, Class compType, Deque<JsonObject> stack)
public abstract void traverseFields(Deque<JsonObject> stack, JsonObject jsonObj)
public abstract void traverseFields(Deque<JsonObject> stack, JsonObject jsonObj, Set<String> excludeFields)
protected abstract void traverseCollection(Deque<JsonObject> stack, JsonObject jsonObj)
protected abstract void traverseArray(Deque<JsonObject> stack, JsonObject jsonObj)
protected void cleanup()
protected void traverseMap(Deque<JsonObject> stack, JsonObject jsonObj)
stack
- a Stack (Deque) used to support graph traversal.jsonObj
- a Map-of-Map representation of the JSON input stream.protected static void convertMapToKeysItems(JsonObject map)
map
- Map to convertprotected Object createInstance(Class clazz, JsonObject jsonObj)
clazz
- Instance will be create of this class.jsonObj
- Map-of-Map representation of object to create.protected Object createInstanceUsingType(JsonObject jsonObj)
protected Object createInstanceUsingClass(Class clazz, JsonObject jsonObj)
protected JsonReader.JsonClassReader getCustomReader(Class c)
protected EnumSet<?> extractEnumSet(Class c, JsonObject jsonObj)
protected void patchUnresolvedReferences()
protected void rehashMaps()
Copyright © 2023. All rights reserved.