Class JavaSqlBlobSerializer

All Implemented Interfaces:
JsonFormatVisitable

public class JavaSqlBlobSerializer extends StdScalarSerializer<Blob>
Serializer implementation for Blob to write as binary (for JSON and other formats Base64-encoded String, for binary formats as true binary).
See Also:
  • Field Details

  • Constructor Details

    • JavaSqlBlobSerializer

      public JavaSqlBlobSerializer()
  • Method Details

    • isEmpty

      public boolean isEmpty(SerializationContext provider, Blob value)
      Description copied from class: ValueSerializer
      Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

      Default implementation will consider only null values to be empty.

      Overrides:
      isEmpty in class ValueSerializer<Blob>
    • serialize

      public void serialize(Blob value, tools.jackson.core.JsonGenerator gen, SerializationContext ctxt) throws tools.jackson.core.JacksonException
      Description copied from class: ValueSerializer
      Method that can be called to ask implementation to serialize values of type this serializer handles.
      Specified by:
      serialize in class StdSerializer<Blob>
      Parameters:
      value - Value to serialize; can not be null.
      gen - Generator used to output resulting Json content
      ctxt - Context that can be used to get serializers for serializing Objects value contains, if any.
      Throws:
      tools.jackson.core.JacksonException
    • serializeWithType

      public void serializeWithType(Blob value, tools.jackson.core.JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) throws tools.jackson.core.JacksonException
      Description copied from class: StdScalarSerializer
      Default implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix. This should work for most cases; some sub-classes may want to change this behavior.
      Overrides:
      serializeWithType in class StdScalarSerializer<Blob>
      Parameters:
      value - Value to serialize; can not be null.
      gen - Generator used to output resulting Json content
      ctxt - Context that can be used to get serializers for serializing Objects value contains, if any.
      typeSer - Type serializer to use for including type information
      Throws:
      tools.jackson.core.JacksonException
    • _writeValue

      protected void _writeValue(Blob value, tools.jackson.core.JsonGenerator gen, SerializationContext ctxt) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • acceptJsonFormatVisitor

      public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
      Description copied from class: StdSerializer
      Default implementation specifies no format. This behavior is usually overriden by custom serializers.
      Specified by:
      acceptJsonFormatVisitor in interface JsonFormatVisitable
      Overrides:
      acceptJsonFormatVisitor in class StdScalarSerializer<Blob>
      typeHint - Type of element (entity like property) being visited