Package dev.orne.i18n
Class I18nStringJacksonDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<I18nString>
dev.orne.i18n.I18nStringJacksonDeserializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.ContextualDeserializer,com.fasterxml.jackson.databind.deser.NullValueProvider
@API(status=INTERNAL,
since="0.1")
public class I18nStringJacksonDeserializer
extends com.fasterxml.jackson.databind.JsonDeserializer<I18nString>
implements com.fasterxml.jackson.databind.deser.ContextualDeserializer
Jackson JSON deserializer for
I18nString instances.- Since:
- 0.1
- Version:
- 1.0, 2021-02
- Author:
- (w) Iker Hernaez
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new instance.protectedI18nStringJacksonDeserializer(I18nStringConverter converter) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonDeserializer<?>createContextual(@NotNull com.fasterxml.jackson.databind.DeserializationContext ctxt, com.fasterxml.jackson.databind.BeanProperty property) deserialize(@NotNull com.fasterxml.jackson.core.JsonParser parser, @NotNull com.fasterxml.jackson.databind.DeserializationContext context) protected I18nStringConvertergetConverter(@NotNull Class<?> targetType) Returns a converter that convertsI18nStringinstances to the specified target type.Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
I18nStringJacksonDeserializer
public I18nStringJacksonDeserializer()Creates a new instance. -
I18nStringJacksonDeserializer
Creates a new instance.- Parameters:
converter- The converter fromI18nStringto the target type
-
-
Method Details
-
createContextual
public com.fasterxml.jackson.databind.JsonDeserializer<?> createContextual(@NotNull @NotNull com.fasterxml.jackson.databind.DeserializationContext ctxt, com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException - Specified by:
createContextualin interfacecom.fasterxml.jackson.databind.deser.ContextualDeserializer- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
getConverter
Returns a converter that convertsI18nStringinstances to the specified target type.- Parameters:
targetType- The target type.- Returns:
- The
I18nStringtype converter.
-
deserialize
public I18nString deserialize(@NotNull @NotNull com.fasterxml.jackson.core.JsonParser parser, @NotNull @NotNull com.fasterxml.jackson.databind.DeserializationContext context) throws IOException - Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<I18nString>- Throws:
IOException
-