Package com.cedarsoftware.util.io
Interface ReaderContext
- All Known Implementing Classes:
JsonReader
,MapResolver
,ObjectResolver
,Resolver
public interface ReaderContext
-
Method Summary
Modifier and TypeMethodDescriptioncom.cedarsoftware.util.convert.Converter
<T> T
reentrantConvertJsonValueToJava
(JsonObject root, Class<T> hint) This method converts a rootObj Map, (which contains nested Maps and so forth representing a Java Object graph), to a Java object instance.void
traverseFields
(Deque<JsonObject> stack, JsonObject jsonObj) Walk the Java object fields and copy them from the JSON object to the Java object, performing any necessary conversions on primitives, or deep traversals for field assignments to other objects, arrays, Collections, or Maps.
-
Method Details
-
getReferences
ReferenceTracker getReferences() -
reentrantConvertJsonValueToJava
This method converts a rootObj Map, (which contains nested Maps and so forth representing a Java Object graph), to a Java object instance. The rootObj map came from using the JsonReader to parse a JSON graph (using the API that puts the graph into Maps, not the typed representation).- Parameters:
root
- JsonObject instance that was the rootObj object from thehint
- When you know the type you will be returning. Can be null (effectively Map.class) JSON input that was parsed in an earlier call to JsonReader.- Returns:
- a typed Java instance that was serialized into JSON.
-
traverseFields
Walk the Java object fields and copy them from the JSON object to the Java object, performing any necessary conversions on primitives, or deep traversals for field assignments to other objects, arrays, Collections, or Maps.- Parameters:
stack
- Stack (Deque) used for graph traversal.jsonObj
- a Map-of-Map representation of the current object being examined (containing all fields).
-
getReadOptions
ReadOptions getReadOptions() -
getConverter
com.cedarsoftware.util.convert.Converter getConverter()
-