public final class MetadataHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MetadataHelper.AdaptFailure |
| Constructor and Description |
|---|
MetadataHelper() |
public static boolean areGenericsSupported(TypeDefinition t)
public static int getArrayRank(TypeReference t)
public static boolean isEnclosedBy(TypeReference innerType, TypeReference outerType)
public static boolean canReferenceTypeVariablesOf(TypeReference declaringType, TypeReference referenceSite)
public static TypeReference findCommonSuperType(TypeReference type1, TypeReference type2)
public static ConversionType getConversionType(TypeReference target, TypeReference source)
public static ConversionType getNumericConversionType(TypeReference target, TypeReference source)
public static boolean hasImplicitNumericConversion(TypeReference target, TypeReference source)
public static boolean isConvertible(TypeReference source, TypeReference target)
public static boolean isConvertible(TypeReference source, TypeReference target, boolean allowUnchecked)
public static boolean isAssignableFrom(TypeReference target, TypeReference source)
public static boolean isAssignableFrom(TypeReference target, TypeReference source, boolean allowUnchecked)
public static boolean isSubType(TypeReference type, TypeReference baseType)
public static boolean isPrimitiveBoxType(TypeReference type)
public static TypeReference getBoxedTypeOrSelf(TypeReference type)
public static TypeReference getUnderlyingPrimitiveTypeOrSelf(TypeReference type)
public static TypeReference getDeclaredType(TypeReference type)
public static TypeReference getBaseType(TypeReference type)
public static java.util.List<TypeReference> getInterfaces(TypeReference type)
public static TypeReference asSubType(TypeReference type, TypeReference baseType)
public static TypeReference asSuper(TypeReference type, TypeReference subType)
public static java.util.Map<TypeReference,TypeReference> getGenericSubTypeMappings(TypeReference type, TypeReference baseType)
public static MethodReference asMemberOf(MethodReference method, TypeReference baseType)
public static FieldReference asMemberOf(FieldReference field, TypeReference baseType)
public static TypeReference substituteGenericArguments(TypeReference inputType, TypeReference substitutionsProvider)
public static TypeReference substituteGenericArguments(TypeReference inputType, MethodReference substitutionsProvider)
public static TypeReference substituteGenericArguments(TypeReference inputType, java.util.Map<TypeReference,TypeReference> substitutionsProvider)
public static java.util.List<MethodReference> findMethods(TypeReference type)
public static java.util.List<MethodReference> findMethods(TypeReference type, com.strobel.core.Predicate<? super MethodReference> filter)
public static java.util.List<MethodReference> findMethods(TypeReference type, com.strobel.core.Predicate<? super MethodReference> filter, boolean includeBridgeMethods)
public static java.util.List<MethodReference> findMethods(TypeReference type, com.strobel.core.Predicate<? super MethodReference> filter, boolean includeBridgeMethods, boolean includeOverriddenMethods)
public static boolean isOverloadCheckingRequired(MethodReference method)
public static TypeReference getLowerBound(TypeReference t)
public static TypeReference getUpperBound(TypeReference t)
public static TypeReference getElementType(TypeReference t)
public static TypeReference getSuperType(TypeReference t)
public static boolean isSubTypeNoCapture(TypeReference type, TypeReference baseType)
public static boolean isSubType(TypeReference type, TypeReference baseType, boolean capture)
public static java.util.Map<TypeReference,TypeReference> adapt(TypeReference source, TypeReference target)
public static boolean containsType(TypeReference t, TypeReference s)
t contains s.
T contains S if:
L(T) <: L(S) && U(S) <: U(T)
This relation is only used by isSubType(), that is:
C<S> <: C<T> if T contains S.
Because of F-bounds, this relation can lead to infinite recursion. Thus, we must somehow break that recursion. Notice that containsType() is only called from isSubType(). Since the arguments have already been checked against their bounds, we know:
U(S) <: U(T) if T is "super" bound (U(T) *is* the bound)
L(T) <: L(S) if T is "extends" bound (L(T) is bottom)
t - a types - a typepublic static boolean isSameType(TypeReference t, TypeReference s)
public static boolean isSameType(TypeReference t, TypeReference s, boolean strict)
public static boolean areSameTypes(java.util.List<? extends TypeReference> t, java.util.List<? extends TypeReference> s)
public static boolean areSameTypes(java.util.List<? extends TypeReference> t, java.util.List<? extends TypeReference> s, boolean strict)
public static boolean isRawType(TypeReference t)
public static int getUnboundGenericParameterCount(TypeReference t)
public static java.util.List<TypeReference> eraseRecursive(java.util.List<TypeReference> types)
public static TypeReference eraseRecursive(TypeReference type)
public static TypeReference erase(TypeReference type)
public static TypeReference erase(TypeReference type, boolean recurse)
public static MethodReference erase(MethodReference method)
public static boolean isOverride(MethodDefinition method, MethodReference ancestorMethod)