Class BeanSerializer

    • Constructor Detail

      • BeanSerializer

        public BeanSerializer​(JavaType type,
                              BeanSerializerBuilder builder,
                              BeanPropertyWriter[] properties,
                              BeanPropertyWriter[] filteredProperties)
        builder - Builder object that contains collected information that may be needed for serializer
        properties - Property writers used for actual serialization
    • Method Detail

      • createDummy

        public static BeanSerializer createDummy​(JavaType forType)
        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

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

        public final void serialize​(java.lang.Object bean,
                                    JsonGenerator gen,
                                    SerializerProvider provider)
        Main serialization method that will delegate actual output to configured BeanPropertyWriter instances.
        Specified by:
        serialize in class BeanSerializerBase
        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.
      • toString

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