Package com.backblaze.b2.json
Class B2JsonHandlerMap
- java.lang.Object
-
- com.backblaze.b2.json.B2JsonHandlerMap
-
public class B2JsonHandlerMap extends java.lang.Object
Holds a mapping from Class to B2JsonTypeHandler.The mapping starts out with initial contents, which must be ALL of the non-default mappings that will be used. If any other handlers are needed, the default B2JsonObjectHandler will be used for that class.
This class is THREAD SAFE.
-
-
Constructor Summary
Constructors Constructor Description B2JsonHandlerMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> B2JsonTypeHandler<T>
getHandler(java.lang.reflect.Type type)
Gets the handler for a given class at the top level.
-
-
-
Method Detail
-
getHandler
public <T> B2JsonTypeHandler<T> getHandler(java.lang.reflect.Type type) throws B2JsonException
Gets the handler for a given class at the top level.This method is called when it's time to (de)serialize some JSON, from the toJson() and fromJson() methods. It is not called by other handlers. When one handler depends on another, it should call the getUninitializedHandler() method from its own initialize() method.
So, this method does NOT need to be re-entrant, and in fact we assume that it's not.
- Throws:
B2JsonException
-
-