Class DeserializerUtils
java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.serialization.DeserializerUtils
Utility methods to help with deserializing JSON streams into QQQ models.
Specifically meant to be used within a jackson custom deserializer (e.g.,
an implementation of JsonDeserializer).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QBackendModuleInterface
getBackendModule
(com.fasterxml.jackson.core.TreeNode treeNode) For a given (jackson, JSON) treeNode, look at its backendType property, and return an instance of the corresponding QBackendModule.static String
readTextValue
(com.fasterxml.jackson.core.TreeNode treeNode, String key) Read a string value, identified by key, from a jackson treeNode.static <T> T
reflectivelyDeserialize
(Class<T> outputClass, com.fasterxml.jackson.core.TreeNode treeNode) Using reflection, create invalid input: '&' populate an instance of a class, based on the properties in a jackson/json treeNode.
-
Constructor Details
-
DeserializerUtils
public DeserializerUtils()
-
-
Method Details
-
readTextValue
public static String readTextValue(com.fasterxml.jackson.core.TreeNode treeNode, String key) throws IOException Read a string value, identified by key, from a jackson treeNode.- Throws:
IOException
-
getBackendModule
public static QBackendModuleInterface getBackendModule(com.fasterxml.jackson.core.TreeNode treeNode) throws IOException For a given (jackson, JSON) treeNode, look at its backendType property, and return an instance of the corresponding QBackendModule.- Throws:
IOException
-
reflectivelyDeserialize
public static <T> T reflectivelyDeserialize(Class<T> outputClass, com.fasterxml.jackson.core.TreeNode treeNode) throws IOException Using reflection, create invalid input: '&' populate an instance of a class, based on the properties in a jackson/json treeNode.- Throws:
IOException
-