Class BeanSerializer

    • Method Detail

      • createDummy

        @Deprecated
        public static BeanSerializer createDummy​(JavaType forType)
        Deprecated.
        Since 2.10
      • unwrappingSerializer

        public JsonSerializer<java.lang.Object> unwrappingSerializer​(NameTransformer unwrapper)
        Description copied from class: JsonSerializer
        Method that will return serializer instance that produces "unwrapped" serialization, if applicable for type being serialized (which is the case for some serializers that produce JSON Objects as output). If no unwrapped serializer can be constructed, will simply return serializer as-is.

        Default implementation just returns serializer as-is, indicating that no unwrapped variant exists

        Overrides:
        unwrappingSerializer in class JsonSerializer<java.lang.Object>
        Parameters:
        unwrapper - Name transformation to use to convert between names of unwrapper properties
      • withByNameInclusion

        protected BeanSerializerBase withByNameInclusion​(java.util.Set<java.lang.String> toIgnore,
                                                         java.util.Set<java.lang.String> toInclude)
        Description copied from class: BeanSerializerBase
        Mutant factory used for creating a new instance with additional set of properties to ignore or include (from properties this instance otherwise has)
        Specified by:
        withByNameInclusion in class BeanSerializerBase
      • serialize

        public final void serialize​(java.lang.Object bean,
                                    com.fasterxml.jackson.core.JsonGenerator gen,
                                    SerializerProvider provider)
                             throws java.io.IOException
        Main serialization method that will delegate actual output to configured BeanPropertyWriter instances.
        Specified by:
        serialize in class BeanSerializerBase
        Parameters:
        bean - Value to serialize; can not be null.
        gen - Generator used to output resulting Json content
        provider - Provider that can be used to get serializers for serializing Objects value contains, if any.
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object