Class ElasticObjectSerializer<T extends co.elastic.clients.json.JsonpSerializable>

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<T>
com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
com.atlan.serde.ElasticObjectSerializer<T>
Type Parameters:
T - the type of Elastic object to serialize
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, com.fasterxml.jackson.databind.jsonschema.SchemaAware, Serializable

public class ElasticObjectSerializer<T extends co.elastic.clients.json.JsonpSerializable> extends com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
Custom serialization of Elastic objects into the JSON expected by Atlan's search interfaces. We reuse the Elastic client to allow full richness and flexibility in defining the queries themselves, but this custom serialization is then necessary as the underlying objects of the Elastic client itself do not exactly match the expected JSON serialization format. (Thankfully all we need to do is call Elastic's own underlying serialization methods to get there, though!)
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

    com.fasterxml.jackson.databind.JsonSerializer.None
  • Field Summary

    Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _handledType
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serialize(T src, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider sp)
     
    void
    serializeWithType(T src, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)
     

    Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow

    Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

    getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties

    Methods inherited from class java.lang.Object

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

    • ElasticObjectSerializer

      public ElasticObjectSerializer()
    • ElasticObjectSerializer

      public ElasticObjectSerializer(Class<T> t)
  • Method Details

    • serializeWithType

      public void serializeWithType(T src, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) throws IOException
      Overrides:
      serializeWithType in class com.fasterxml.jackson.databind.JsonSerializer<T extends co.elastic.clients.json.JsonpSerializable>
      Throws:
      IOException
    • serialize

      public void serialize(T src, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider sp) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
      Specified by:
      serialize in class com.fasterxml.jackson.databind.ser.std.StdSerializer<T extends co.elastic.clients.json.JsonpSerializable>
      Throws:
      IOException
      com.fasterxml.jackson.core.JsonProcessingException