Resolve a sub type of the given super type.

@param superType
the super type
@param subType
the sub type to resolve
@return
resolved type
@see TypeResolver#resolveSubtype(ResolvedType, Class)
10561
@NonNull
	public static ResolvedType resolveSubtype(@NonNull ResolvedType superType, @NonNull Class<?> subType)
	{
		return typeResolver.resolveSubtype(superType, subType);
	}
691707
public static Type resolveRefType(Type type) {
        if (type == null)
            return null;

        if (type instanceof RefType)
            return resolveRefType(((RefType) type).getRefType());
        else
            return type;
    }
397121
private void indexSupertypes(TypeElement rootElement, TypeElement element) throws IOException {

		for (TypeMirror mirror : types.directSupertypes(element.asType())) {
			if (mirror.getKind() != TypeKind.DECLARED) {
				continue;
			}

			DeclaredType superType = (DeclaredType) mirror;
			TypeElement superTypeElement = (TypeElement) superType.asElement();
			storeSubclass(superTypeElement, rootElement);

			for (AnnotationMirror annotationMirror : superTypeElement.getAnnotationMirrors()) {
				TypeElement annotationElement = (TypeElement) annotationMirror.getAnnotationType()
						.asElement();

				if (hasAnnotation(annotationElement, Inherited.class)) {
					storeAnnotation(annotationElement, rootElement);
				}
			}

			indexSupertypes(rootElement, superTypeElement);
		}
	}
796592
public HttpMediaType setSubType(String subType) {
    Preconditions.checkArgument(
        TYPE_REGEX.matcher(subType).matches(), "Subtype contains reserved characters");
    this.subType = subType;
    cachedBuildResult = null;
    return this;
  }
388943
public static Class[] resolveSuperTypeGenericArguments(Class<?> type, Class<?> superTypeToResolve) {
        Type supertype = type.getGenericSuperclass();
        Class<?> superclass = type.getSuperclass();
        while (superclass != null && superclass != Object.class) {
            if (supertype instanceof ParameterizedType) {
                ParameterizedType pt = (ParameterizedType) supertype;
                if (pt.getRawType() == superTypeToResolve) {
                    return resolveTypeArguments(supertype);
                }
            }

            supertype = superclass.getGenericSuperclass();
            superclass = superclass.getSuperclass();
        }
        return ReflectionUtils.EMPTY_CLASS_ARRAY;
    }
968683
private Class<?> resolveClass(Type type) {
    if (type instanceof Class) {
      return (Class<?>) type;
    } else if (type instanceof ParameterizedType) {
      return resolveClass(((ParameterizedType) type).getRawType());
    } else if (type instanceof WildcardType) {
      Type[] bounds = ((WildcardType) type).getUpperBounds();
      if (bounds.length > 0) {
        return (Class<?>) bounds[0];
      }
    }
    return null;
  }
650399
protected Map<String, Object> resolveGenericTypes(TypeMirror type, Map<String, Object> boundTypes) {
        if (type.getKind().isPrimitive() || type.getKind() == VOID || type.getKind() == ARRAY) {
            return Collections.emptyMap();
        }
        if (type instanceof DeclaredType) {
            DeclaredType declaredType = (DeclaredType) type;
            return resolveGenericTypes(declaredType, (TypeElement) declaredType.asElement(), boundTypes);
        } else if (type instanceof TypeVariable) {
            TypeVariable var = (TypeVariable) type;
            TypeMirror upperBound = var.getUpperBound();
            if (upperBound instanceof DeclaredType) {
                return resolveGenericTypes(upperBound, boundTypes);
            }
        }
        return Collections.emptyMap();
    }
1080902
public void resolveBaseTypes(List<ModelElementType> baseTypes) {
    if (baseType != null) {
      baseTypes.add(baseType);
      baseType.resolveBaseTypes(baseTypes);
    }
  }
331701
private TypeResolver getTypeResolver() {
        TypeResolver typeResolver = scannerContext.peek(TypeResolver.class);
        if (typeResolver == null) {
            throw new IllegalStateException("Cannot find Java type resolver.");
        }
        return typeResolver;
    }
534097
public ResolvableType resolveType() {
        if (this.type instanceof ParameterizedType) {
            return forType(((ParameterizedType) this.type).getRawType(), this.variableResolver);
        }
        if (this.type instanceof WildcardType) {
            Type resolved = resolveBounds(((WildcardType) this.type).getUpperBounds());
            if (resolved == null) {
                resolved = resolveBounds(((WildcardType) this.type).getLowerBounds());
            }
            return forType(resolved, this.variableResolver);
        }
        if (this.type instanceof TypeVariable) {
            TypeVariable<?> variable = (TypeVariable<?>) this.type;
            // Try default variable resolution
            if (this.variableResolver != null) {
                ResolvableType resolved = this.variableResolver.resolveVariable(variable);
                if (resolved != null) {
                    return resolved;
                }
            }
            // Fallback to bounds
            return forType(resolveBounds(variable.getBounds()), this.variableResolver);
        }
        return NONE;
    }
417237
final Collection<JcrNodeType> subtypesFor( JcrNodeType nodeType ) {
        List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>();
        for (JcrNodeType type : this.nodeTypes.values()) {
            if (type.supertypes().contains(nodeType)) {
                subtypes.add(type);
            }
        }
        return subtypes;
    }
322339
private void addSubType(FunctionType subType) {
    if (subTypes == null) {
      subTypes = new ArrayList<>();
    }
    subTypes.add(subType);
  }
1200711
public static boolean isSubtype(Type s, Type t, VisitorState state) {
    if (s == null || t == null) {
      return false;
    }
    if (SUBTYPE_UNDEFINED.contains(s.getTag()) || SUBTYPE_UNDEFINED.contains(t.getTag())) {
      return false;
    }
    Types types = state.getTypes();
    return types.isSubtype(types.erasure(s), types.erasure(t));
  }
1025177
public void setTypeResolver(RelationshipResolver resolver, Class<?> type) {
		if (resolver != null) {
			String typeName = ReflectionUtils.getTypeName(type);

			if (typeName != null) {
				typedResolvers.put(type, resolver);
			}
		}
	}
1076409
@NonNull
	public static ResolvedTypeWithMembers resolveMembers(@NonNull ResolvedType mainType)
	{
		return memberResolver.resolve(mainType, null, null);
	}
1191473
protected Map<String, Object> resolveBoundTypes(DeclaredType type) {
        Map<String, Object> boundTypes = new LinkedHashMap<>(2);
        TypeElement element = (TypeElement) type.asElement();

        List<? extends TypeParameterElement> typeParameters = element.getTypeParameters();
        List<? extends TypeMirror> typeArguments = type.getTypeArguments();
        if (typeArguments.size() == typeParameters.size()) {
            Iterator<? extends TypeMirror> i = typeArguments.iterator();
            for (TypeParameterElement typeParameter : typeParameters) {
                boundTypes.put(typeParameter.toString(), resolveTypeReference(i.next(), boundTypes));
            }
        }

        return boundTypes;
    }
1320419
@NonNull
	public static ResolvedTypeWithMembers resolveMembers(@NonNull Type type, @NonNull Type... typeParameters)
	{
		ResolvedType rt = typeResolver.resolve(type, typeParameters);
		return memberResolver.resolve(rt, null, null);
	}