Class DeserializerUtils

java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.serialization.DeserializerUtils

public class DeserializerUtils extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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