public GenericJackson2JsonRedisSerializer(@Nullable String classPropertyTypeName) {
this(new ObjectMapper());
// simply setting {@code mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)} does not help here since we need // the type hint embedded for deserialization using the default typing feature. registerNullValueSerializer(mapper, classPropertyTypeName);
publicenum DefaultTyping { /** * This value means that only properties that have * {@link java.lang.Object} as declared type (including * generic types without explicit type) will use default * typing. */ JAVA_LANG_OBJECT,
/** * Value that means that default typing will be used for * properties with declared type of {@link java.lang.Object} * or an abstract type (abstract class or interface). * Note that this does <b>not</b> include array types. *<p> * Since 2.4, this does NOT apply to {@link TreeNode} and its subtypes. */ OBJECT_AND_NON_CONCRETE,
/** * Value that means that default typing will be used for * all types covered by {@link #OBJECT_AND_NON_CONCRETE} * plus all array types for them. *<p> * Since 2.4, this does NOT apply to {@link TreeNode} and its subtypes. */ NON_CONCRETE_AND_ARRAYS,
/** * Value that means that default typing will be used for * all non-final types, with exception of small number of * "natural" types (String, Boolean, Integer, Double), which * can be correctly inferred from JSON; as well as for * all arrays of non-final types. *<p> * Since 2.4, this does NOT apply to {@link TreeNode} and its subtypes. */ NON_FINAL,
/** * Value that means that default typing will be used for * all non-final types, with exception of small number of * "natural" types (String, Boolean, Integer, Double) that * can be correctly inferred from JSON, and primitives (which * can not be polymorphic either). Typing is also enabled for * all array types. *<p> * Note that the only known use case for this setting is for serialization * when passing instances of final class, and base type is not * separately specified. * * @since 2.10 */ EVERYTHING }
java.lang.UnsupportedOperationException: com.fasterxml.jackson.databind.JsonMappingException: Unexpected token(START_OBJECT), expected VALUE_STRING: need JSON String that contains type id(for subtype of java.util.List)