Annotation Interface JacksonComponent


@Target(TYPE) @Retention(RUNTIME) @Documented @Component public @interface JacksonComponent
@Component that provides ValueSerializer, ValueDeserializer or KeyDeserializer implementations to be registered with Jackson when JacksonComponentModule is in use. Can be used to annotate implementations directly or a class that contains them as inner-classes. For example:
@JacksonComponent
public class CustomerJacksonComponent {

    public static class Serializer extends ValueSerializer<Customer> {

        // ...

    }

    public static class Deserializer extends ValueDeserializer<Customer> {

        // ...

    }

}

Since:
4.0.0
Author:
Phillip Webb, Paul Aly
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The various scopes under which a serializer/deserializer can be registered.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The scope under which the serializer/deserializer should be registered with the module.
    Class<?>[]
    The types that are handled by the provided serializer/deserializer.
    The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an auto-detected component.
  • Element Details

    • value

      The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an auto-detected component.
      Returns:
      the component name
      Default:
      ""
    • type

      Class<?>[] type
      The types that are handled by the provided serializer/deserializer. This attribute is mandatory for a KeyDeserializer, as the type cannot be inferred. For a ValueSerializer or ValueDeserializer it can be used to limit handling to a subclasses of type inferred from the generic.
      Returns:
      the types that should be handled by the component
      Default:
      {}
    • scope

      The scope under which the serializer/deserializer should be registered with the module.
      Returns:
      the component's handle type
      Default:
      VALUES