Class DefaultBaseTypeLimitingValidator

java.lang.Object
tools.jackson.databind.jsontype.PolymorphicTypeValidator
tools.jackson.databind.jsontype.DefaultBaseTypeLimitingValidator
All Implemented Interfaces:
Serializable

public class DefaultBaseTypeLimitingValidator extends PolymorphicTypeValidator implements Serializable
PolymorphicTypeValidator that will only allow polymorphic handling if the base type is NOT one of potential dangerous base types (see isUnsafeBaseType(DatabindContext, JavaType) for specific list of such base types).

This implementation is the default one used for annotation-based polymorphic deserialization. Default Typing requires explicit registration of validator; while this implementation may be used users are recommended to either use a custom implementation or sub-class this implementation and override either validateSubClassName(DatabindContext, JavaType, String) or validateSubType(DatabindContext, JavaType, JavaType) to implement use-case specific validation.

Note that when using potentially unsafe base type like Object a custom implementation (or subtype with override) is needed. Most commonly subclasses would override both isUnsafeBaseType(DatabindContext, JavaType) and isSafeSubType(DatabindContext, JavaType, JavaType): former to allow all (or just more) base types, and latter to add actual validation of subtype.

See Also: