批注接口 JsonComponent


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

     public static class Serializer extends JsonSerializer<Customer> {

         // ...

     }

     public static class Deserializer extends JsonDeserializer<Customer> {

         // ...

     }

 }

 
从以下版本开始:
1.4.0
作者:
Phillip Webb, Paul Aly
另请参阅:
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    static enum 
    The various scopes under which a serializer/deserializer can be registered.
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    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 autodetected component.
  • 元素详细资料

    • value

      The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.
      返回:
      the component name
      默认值:
      ""
    • 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 JsonSerializer or JsonDeserializer it can be used to limit handling to a subclasses of type inferred from the generic.
      返回:
      the types that should be handled by the component
      从以下版本开始:
      2.2.0
      默认值:
      {}
    • scope

      The scope under which the serializer/deserializer should be registered with the module.
      返回:
      the component's handle type
      从以下版本开始:
      2.2.0
      默认值:
      VALUES