Class ObjectContainerSerializer

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, com.fasterxml.jackson.databind.jsonschema.SchemaAware, com.fasterxml.jackson.databind.ser.ContextualSerializer, java.io.Serializable

    public class ObjectContainerSerializer
    extends ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
    implements com.fasterxml.jackson.databind.ser.ContextualSerializer
    Note: this implementation does not yet properly handle all polymorphic cases
    See Also:
    Serialized Form
    • Nested Class Summary

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

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

      Fields 
      Modifier and Type Field Description
      protected com.fasterxml.jackson.databind.JavaType _contentType  
      protected com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer _delegate
      We will basically just delegate serialization to the standard Object[] serializer; as we can not sub-class it.
      private static long serialVersionUID  
      • Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

        _handledType
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        ObjectContainerSerializer​(com.fasterxml.jackson.databind.type.CollectionLikeType containerType, com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer delegate)  
      protected ObjectContainerSerializer​(ObjectContainerSerializer base, com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.fasterxml.jackson.databind.ser.ContainerSerializer<?> _withValueTypeSerializer​(com.fasterxml.jackson.databind.jsontype.TypeSerializer vts)  
      void acceptJsonFormatVisitor​(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor, com.fasterxml.jackson.databind.JavaType typeHint)  
      com.fasterxml.jackson.databind.JsonSerializer<?> createContextual​(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.databind.BeanProperty property)  
      com.fasterxml.jackson.databind.JsonSerializer<?> getContentSerializer()  
      com.fasterxml.jackson.databind.JavaType getContentType()  
      boolean hasSingleElement​(com.carrotsearch.hppc.ObjectContainer<?> value)  
      boolean isEmpty​(com.fasterxml.jackson.databind.SerializerProvider provider, com.carrotsearch.hppc.ObjectContainer<?> value)  
      void serialize​(com.carrotsearch.hppc.ObjectContainer<?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider)  
      protected void serializeContents​(com.carrotsearch.hppc.ObjectContainer<?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider)  
      void serializeWithType​(com.carrotsearch.hppc.ObjectContainer<?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)  
      protected ObjectContainerSerializer withDelegate​(com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer newDelegate)  
      • Methods inherited from class com.fasterxml.jackson.databind.ser.ContainerSerializer

        hasContentTypeAnnotation, withValueTypeSerializer
      • Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

        _neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
      • Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

        getDelegatee, 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
    • Field Detail

      • _contentType

        protected final com.fasterxml.jackson.databind.JavaType _contentType
      • _delegate

        protected final com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer _delegate
        We will basically just delegate serialization to the standard Object[] serializer; as we can not sub-class it.
    • Constructor Detail

      • ObjectContainerSerializer

        public ObjectContainerSerializer​(com.fasterxml.jackson.databind.type.CollectionLikeType containerType,
                                         com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer delegate)
      • ObjectContainerSerializer

        protected ObjectContainerSerializer​(ObjectContainerSerializer base,
                                            com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer delegate)
    • Method Detail

      • withDelegate

        protected ObjectContainerSerializer withDelegate​(com.fasterxml.jackson.databind.ser.std.ObjectArraySerializer newDelegate)
      • _withValueTypeSerializer

        protected com.fasterxml.jackson.databind.ser.ContainerSerializer<?> _withValueTypeSerializer​(com.fasterxml.jackson.databind.jsontype.TypeSerializer vts)
        Overrides:
        _withValueTypeSerializer in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
      • acceptJsonFormatVisitor

        public void acceptJsonFormatVisitor​(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor,
                                            com.fasterxml.jackson.databind.JavaType typeHint)
                                     throws com.fasterxml.jackson.databind.JsonMappingException
        Specified by:
        acceptJsonFormatVisitor in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
        Specified by:
        acceptJsonFormatVisitor in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
        Throws:
        com.fasterxml.jackson.databind.JsonMappingException
      • hasSingleElement

        public boolean hasSingleElement​(com.carrotsearch.hppc.ObjectContainer<?> value)
        Specified by:
        hasSingleElement in class com.fasterxml.jackson.databind.ser.ContainerSerializer<com.carrotsearch.hppc.ObjectContainer<?>>
      • isEmpty

        public boolean isEmpty​(com.fasterxml.jackson.databind.SerializerProvider provider,
                               com.carrotsearch.hppc.ObjectContainer<?> value)
        Specified by:
        isEmpty in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
      • getContentType

        public com.fasterxml.jackson.databind.JavaType getContentType()
        Overrides:
        getContentType in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
      • createContextual

        public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual​(com.fasterxml.jackson.databind.SerializerProvider prov,
                                                                                 com.fasterxml.jackson.databind.BeanProperty property)
                                                                          throws com.fasterxml.jackson.databind.JsonMappingException
        Specified by:
        createContextual in interface com.fasterxml.jackson.databind.ser.ContextualSerializer
        Throws:
        com.fasterxml.jackson.databind.JsonMappingException
      • serialize

        public void serialize​(com.carrotsearch.hppc.ObjectContainer<?> value,
                              com.fasterxml.jackson.core.JsonGenerator gen,
                              com.fasterxml.jackson.databind.SerializerProvider provider)
                       throws java.io.IOException
        Overrides:
        serialize in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
        Throws:
        java.io.IOException
      • serializeWithType

        public void serializeWithType​(com.carrotsearch.hppc.ObjectContainer<?> value,
                                      com.fasterxml.jackson.core.JsonGenerator gen,
                                      com.fasterxml.jackson.databind.SerializerProvider provider,
                                      com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)
                               throws java.io.IOException
        Overrides:
        serializeWithType in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
        Throws:
        java.io.IOException
      • serializeContents

        protected void serializeContents​(com.carrotsearch.hppc.ObjectContainer<?> value,
                                         com.fasterxml.jackson.core.JsonGenerator gen,
                                         com.fasterxml.jackson.databind.SerializerProvider provider)
                                  throws java.io.IOException
        Specified by:
        serializeContents in class ContainerSerializerBase<com.carrotsearch.hppc.ObjectContainer<?>>
        Throws:
        java.io.IOException