1 package com.fasterxml.jackson.databind.testutil; 2 3 import com.fasterxml.jackson.databind.JavaType; 4 import com.fasterxml.jackson.databind.cfg.MapperConfig; 5 import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator; 6 7 /** 8 * Test-only {@link PolymorphicTypeValidator} used by tests that should not block 9 * use of any subtypes. 10 */ 11 public final class NoCheckSubTypeValidator 12 extends PolymorphicTypeValidator.Base 13 { 14 private static final long serialVersionUID = 1L; 15 16 public final static NoCheckSubTypeValidator instance = new NoCheckSubTypeValidator(); 17 18 @Override validateBaseType(MapperConfig<?> config, JavaType baseType)19 public Validity validateBaseType(MapperConfig<?> config, JavaType baseType) { 20 return Validity.INDETERMINATE; 21 } 22 23 @Override validateSubClassName(MapperConfig<?> config, JavaType baseType, String subClassName)24 public Validity validateSubClassName(MapperConfig<?> config, 25 JavaType baseType, String subClassName) { 26 return Validity.ALLOWED; 27 } 28 29 @Override validateSubType(MapperConfig<?> config, JavaType baseType, JavaType subType)30 public Validity validateSubType(MapperConfig<?> config, JavaType baseType, 31 JavaType subType) { 32 return Validity.ALLOWED; 33 } 34 }