Class HerodotusUserDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<HerodotusUser>
cn.herodotus.engine.oauth2.core.jackson2.HerodotusUserDeserializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class HerodotusUserDeserializer
extends com.fasterxml.jackson.databind.JsonDeserializer<HerodotusUser>
Description: 自定义 UserDetails 序列化
- Author:
- : gengwei.zheng
- Date:
- : 2022/2/17 21:01
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) This method will createUserobject.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
-
Constructor Details
-
HerodotusUserDeserializer
public HerodotusUserDeserializer()
-
-
Method Details
-
deserialize
public HerodotusUser deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException, com.fasterxml.jackson.core.JsonProcessingException This method will createUserobject. It will ensure successful object creation even if password key is null in serialized json, because credentials may be removed from theUserby invokingUser.eraseCredentials(). In that case there won't be any password key in serialized json.- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<HerodotusUser>- Parameters:
jp- the JsonParserctxt- the DeserializationContext- Returns:
- the user
- Throws:
IOException- if a exception during IO occurscom.fasterxml.jackson.core.JsonProcessingException- if an error during JSON processing occurs
-