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(tools.jackson.databind.DatabindContext, tools.jackson.databind.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(tools.jackson.databind.DatabindContext, tools.jackson.databind.JavaType, java.lang.String) or validateSubType(tools.jackson.databind.DatabindContext, tools.jackson.databind.JavaType, tools.jackson.databind.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(tools.jackson.databind.DatabindContext, tools.jackson.databind.JavaType) and isSafeSubType(tools.jackson.databind.DatabindContext, tools.jackson.databind.JavaType, tools.jackson.databind.JavaType): former to allow all (or just more) base types, and latter to add actual validation of subtype.

See Also: