Package general.gui
Class StrictJsonMapper
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<java.lang.String>
-
- general.gui.StrictJsonMapper
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
@Singleton public class StrictJsonMapper extends com.fasterxml.jackson.databind.JsonDeserializer<java.lang.String>A custom JSON deserializer with strict validation settings to enforce rigid mapping rules.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringdeserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)Can be used as `@JsonDeserialize(using = StrictJsonMapper.class)` on fields.java.util.Optional<java.lang.String>firstFieldName(com.fasterxml.jackson.databind.JsonMappingException e)com.fasterxml.jackson.databind.ObjectMappergetMapper()<T extends play.data.validation.Constraints.Validatable<java.util.List<play.data.validation.ValidationError>>>
TupdateFromJson(T obj, com.fasterxml.jackson.databind.JsonNode json)-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
-
-
-
Method Detail
-
getMapper
public com.fasterxml.jackson.databind.ObjectMapper getMapper()
-
deserialize
public java.lang.String deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws java.io.IOExceptionCan be used as `@JsonDeserialize(using = StrictJsonMapper.class)` on fields. Handles deserialization of JSON strings, returning the text content directly. Throws an error for inputs that are not valid JSON strings.- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<java.lang.String>- Throws:
java.io.IOException
-
updateFromJson
public <T extends play.data.validation.Constraints.Validatable<java.util.List<play.data.validation.ValidationError>>> T updateFromJson(T obj, com.fasterxml.jackson.databind.JsonNode json) throws BadRequestException, java.io.IOException- Throws:
BadRequestExceptionjava.io.IOException
-
firstFieldName
public java.util.Optional<java.lang.String> firstFieldName(com.fasterxml.jackson.databind.JsonMappingException e)
-
-