下面列出了怎么用com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
protected TypeIdResolver idResolver(MapperConfig<?> config, JavaType baseType,
PolymorphicTypeValidator subtypeValidator, Collection<NamedType> subtypes,
boolean forSer, boolean forDeser) {
if (_idType == null) {
throw new IllegalStateException("Can not build, 'init()' not yet called");
}
return new NsTypeIdResolver(baseType, config.getTypeFactory(), basicMetaData);
}