org.springframework.boot.jackson

Annotation Type JsonComponent



  • @Target(value=TYPE)
     @Retention(value=RUNTIME)
     @Documented
     @Component
    public @interface JsonComponent
    Component that provides JsonSerializer and/or JsonDeserializer implementations to be registered with Jackson when JsonComponentModule is in use. Can be used to annotate JsonSerializer or JsonDeserializer 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> {
    
             // ...
    
         }
    
     }
    
     
    Since:
    1.4.0
    Author:
    Phillip Webb
    See Also:
    JsonComponentModule
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      String 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.
    • Element Detail

      • value

        public abstract String 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.
        Returns:
        the component name
        Default:
        ""

Copyright © 2019 Pivotal Software, Inc.. All rights reserved.