Annotation Interface JsonComponent
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Component
@Deprecated(since="4.0.0",
forRemoval=true)
public @interface JsonComponent
Deprecated, for removal: This API element is subject to removal in a future version.
@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> {
// ...
}
}
- Since:
- 4.0.0
- Author:
- Phillip Webb, Paul Aly
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDeprecated, for removal: This API element is subject to removal in a future version.The various scopes under which a serializer/deserializer can be registered. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDeprecated, for removal: This API element is subject to removal in a future version.The scope under which the serializer/deserializer should be registered with the module.Class<?>[]Deprecated, for removal: This API element is subject to removal in a future version.The types that are handled by the provided serializer/deserializer.Deprecated, for removal: This API element is subject to removal in a future version.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 Details
-
value
Deprecated, for removal: This API element is subject to removal in a future version.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:
""
-
type
Class<?>[] typeDeprecated, for removal: This API element is subject to removal in a future version.The types that are handled by the provided serializer/deserializer. This attribute is mandatory for aKeyDeserializer, as the type cannot be inferred. For aJsonSerializerorJsonDeserializerit 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
JsonComponent.Scope scopeDeprecated, for removal: This API element is subject to removal in a future version.The scope under which the serializer/deserializer should be registered with the module.- Returns:
- the component's handle type
- Default:
VALUES
-
JacksonComponent.