Java 类com.fasterxml.jackson.databind.annotation.JsonTypeResolver 实例源码

项目:QuizUpWinner    文件:JacksonAnnotationIntrospector.java   
protected TypeResolverBuilder<?> _findTypeResolver(MapperConfig<?> paramMapperConfig, Annotated paramAnnotated, JavaType paramJavaType)
{
  JsonTypeInfo localJsonTypeInfo = (JsonTypeInfo)paramAnnotated.getAnnotation(JsonTypeInfo.class);
  JsonTypeResolver localJsonTypeResolver = (JsonTypeResolver)paramAnnotated.getAnnotation(JsonTypeResolver.class);
  Object localObject;
  if (localJsonTypeResolver != null)
  {
    if (localJsonTypeInfo == null)
      return null;
    localObject = paramMapperConfig.typeResolverBuilderInstance(paramAnnotated, localJsonTypeResolver.value());
  }
  else
  {
    if (localJsonTypeInfo == null)
      return null;
    if (localJsonTypeInfo.use() == JsonTypeInfo.Id.NONE)
      return _constructNoTypeResolverBuilder();
    localObject = _constructStdTypeResolverBuilder();
  }
  JsonTypeIdResolver localJsonTypeIdResolver = (JsonTypeIdResolver)paramAnnotated.getAnnotation(JsonTypeIdResolver.class);
  TypeIdResolver localTypeIdResolver1;
  if (localJsonTypeIdResolver == null)
    localTypeIdResolver1 = null;
  else
    localTypeIdResolver1 = paramMapperConfig.typeIdResolverInstance(paramAnnotated, localJsonTypeIdResolver.value());
  TypeIdResolver localTypeIdResolver2 = localTypeIdResolver1;
  if (localTypeIdResolver1 != null)
    localTypeIdResolver2.init(paramJavaType);
  TypeResolverBuilder localTypeResolverBuilder1 = ((TypeResolverBuilder)localObject).init(localJsonTypeInfo.use(), localTypeIdResolver2);
  JsonTypeInfo.As localAs1 = localJsonTypeInfo.include();
  JsonTypeInfo.As localAs2 = localAs1;
  if ((localAs1 == JsonTypeInfo.As.EXTERNAL_PROPERTY) && ((paramAnnotated instanceof AnnotatedClass)))
    localAs2 = JsonTypeInfo.As.PROPERTY;
  TypeResolverBuilder localTypeResolverBuilder2 = localTypeResolverBuilder1.inclusion(localAs2).typeProperty(localJsonTypeInfo.property());
  Class localClass = localJsonTypeInfo.defaultImpl();
  if (localClass != JsonTypeInfo.None.class)
    localTypeResolverBuilder2 = localTypeResolverBuilder2.defaultImpl(localClass);
  return localTypeResolverBuilder2.typeIdVisibility(localJsonTypeInfo.visible());
}