Class JsonValueSerializer

All Implemented Interfaces:
ResolvableSerializer, SchemaAware

public class JsonValueSerializer extends SerializerBase<Object> implements ResolvableSerializer, SchemaAware
Serializer class that can serialize Object that have a JsonValue annotation to indicate that serialization should be done by calling the method annotated, and serializing result it returns.

Implementation note: we will post-process resulting serializer (much like what is done with BeanSerializer) to figure out actual serializers for final types. This must be done from resolve(SerializerProvider) method, and NOT from constructor; otherwise we could end up with an infinite loop.

  • Field Details

    • _accessorMethod

      protected final Method _accessorMethod
    • _valueSerializer

      protected JsonSerializer<Object> _valueSerializer
    • _property

      protected final BeanProperty _property
    • _forceTypeInformation

      protected boolean _forceTypeInformation
      This is a flag that is set in rare (?) cases where this serializer is used for "natural" types (boolean, int, String, double); and where we actually must force type information wrapping, even though one would not normally be added.
      Since:
      1.7
  • Constructor Details

  • Method Details