Interface SerializerContext

All Known Implementing Classes:
JsonSerializer

public interface SerializerContext
Serializes and Deserializes the JSON.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    deserialize(File src, Class<T> valueType)
    Deserialize JSON string to a specified type.
    <T> T
    deserialize(InputStream content, Class<T> valueType)
    Deserialize an input stream to a specified type.
    <T> T
    deserialize(String content, com.fasterxml.jackson.core.type.TypeReference<T> valueType)
    Deserialize JSON string to a specified type.
    <T> T
    deserialize(String content, Class<T> valueType)
    Deserialize JSON string to a specified type.
    Serialize an object to JSON string.
    com.fasterxml.jackson.databind.JsonNode
    serialize(String jsonString)
    Serializes JSON string to JSON node.
  • Method Details

    • serialize

      String serialize(Object value) throws AzDException
      Serialize an object to JSON string.
      Parameters:
      value - Object to serialize.
      Returns:
      JSON string.
      Throws:
      AzDException - Default exception handler.
    • serialize

      com.fasterxml.jackson.databind.JsonNode serialize(String jsonString) throws AzDException
      Serializes JSON string to JSON node.
      Parameters:
      jsonString - JSON string to serialize.
      Returns:
      JSON node object.
      Throws:
      AzDException - Default exception handler.
    • deserialize

      <T> T deserialize(String content, Class<T> valueType) throws AzDException
      Deserialize JSON string to a specified type.
      Type Parameters:
      T - Type parameter
      Parameters:
      content - JSON string.
      valueType - Type to convert to.
      Returns:
      Java object of specified type.
      Throws:
      AzDException - Default exception handler.
    • deserialize

      <T> T deserialize(String content, com.fasterxml.jackson.core.type.TypeReference<T> valueType) throws AzDException
      Deserialize JSON string to a specified type.
      Type Parameters:
      T - Type parameter
      Parameters:
      content - JSON string.
      valueType - Type to convert to.
      Returns:
      Java object of specified type.
      Throws:
      AzDException - Default exception handler.
    • deserialize

      <T> T deserialize(InputStream content, Class<T> valueType) throws AzDException
      Deserialize an input stream to a specified type.
      Type Parameters:
      T - Type parameter
      Parameters:
      content - JSON string.
      valueType - Type to convert to.
      Returns:
      Java object of specified type.
      Throws:
      AzDException - Default exception handler.
    • deserialize

      <T> T deserialize(File src, Class<T> valueType) throws AzDException
      Deserialize JSON string to a specified type.
      Type Parameters:
      T - Type parameter
      Parameters:
      src - File that contains JSON string.
      valueType - Type to convert to.
      Returns:
      Java object of specified type.
      Throws:
      AzDException - Default exception handler.