Class JSONSerializerUtil

java.lang.Object
com.pervasive.datarush.json.JSONSerializerUtil

public final class JSONSerializerUtil extends Object
Utilities for custom JSON serializers.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    deserializeRaw(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt, Class<T> clazz)
    Deserialize the value, treating all elements as data rather than as type information.
    static void
    serializeRaw(Object value, com.fasterxml.jackson.core.JsonGenerator jgen, com.fasterxml.jackson.databind.SerializerProvider provider)
    Serialize the value without any type information.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • serializeRaw

      public static void serializeRaw(Object value, com.fasterxml.jackson.core.JsonGenerator jgen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
      Serialize the value without any type information. At times it is convenient to convert an object's internal state into, say, a map of lists and then have Jackson serialize the intermediate object. In those cases we need to suppress type information; otherwise the sub-lists will have type tags.
      Parameters:
      value - the value to serialize
      jgen - the json generator ( this is passed to any custom Jackson serializer )
      provider - the provider ( this is passed to any custom Jackson serializer )
      Throws:
      IOException - if the underlying serializer threw an IOException
      com.fasterxml.jackson.core.JsonProcessingException - if the underlying serializer threw a JsonProcessingException
    • deserializeRaw

      public static <T> T deserializeRaw(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt, Class<T> clazz) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
      Deserialize the value, treating all elements as data rather than as type information. At times it is convenient to convert an object's internal state into, say, a map of lists and then have Jackson serialize the intermediate object. In those cases we need to suppress type information; otherwise the sub-lists will have type tags.
      Type Parameters:
      T - the type to deserialize as
      Parameters:
      jp - the json parser ( this is passed to any custom Jackson deserializer )
      ctxt - the deserialization context ( this is passed to any custom Jackson deserializer )
      clazz - the class to deserialize as
      Returns:
      the parsed object
      Throws:
      IOException - if the underlying deserializer threw an IOException
      com.fasterxml.jackson.core.JsonProcessingException - if the underlying deserializer threw a JsonProcessingException