Package com.strobel.assembler.metadata
Class MetadataHelper
java.lang.Object
com.strobel.assembler.metadata.MetadataHelper
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<TypeReference, TypeReference> adapt(TypeReference source, TypeReference target) static booleanstatic booleanareSameTypes(List<? extends TypeReference> t, List<? extends TypeReference> s) static booleanareSameTypes(List<? extends TypeReference> t, List<? extends TypeReference> s, boolean strict) static FieldReferenceasMemberOf(FieldReference field, TypeReference baseType) static MethodReferenceasMemberOf(MethodReference method, TypeReference baseType) static TypeReferenceasMemberOf(TypeReference innerType, TypeReference baseType) static TypeReferenceasSubType(TypeReference type, TypeReference baseType) static TypeReferenceasSuper(TypeReference type, TypeReference subType) static booleancanReferenceTypeVariablesOf(TypeReference declaringType, TypeReference referenceSite) static booleanCheck iftcontainss.static MethodReferenceerase(MethodReference method) static TypeReferenceerase(TypeReference type) static TypeReferenceerase(TypeReference type, boolean recurse) static TypeReferenceeraseRecursive(TypeReference type) static List<TypeReference> eraseRecursive(List<TypeReference> types) static TypeReferencefindCommonSuperType(TypeReference type1, TypeReference type2) static List<MethodReference> findMethods(TypeReference type) static List<MethodReference> findMethods(TypeReference type, Predicate<? super MethodReference> filter) static List<MethodReference> findMethods(TypeReference type, Predicate<? super MethodReference> filter, boolean includeBridgeMethods) static List<MethodReference> findMethods(TypeReference type, Predicate<? super MethodReference> filter, boolean includeBridgeMethods, boolean includeOverriddenMethods) static intstatic TypeReferencegetBaseType(TypeReference type) static TypeReferencestatic ConversionTypegetConversionType(ICompoundType targetType, TypeReference source) static ConversionTypegetConversionType(TypeReference targetType, ICompoundType source) static ConversionTypegetConversionType(TypeReference target, TypeReference source) static TypeReferencegetDeclaredType(TypeReference type) static TypeReferencestatic Map<TypeReference, TypeReference> getGenericSubTypeMappings(TypeReference type, TypeReference baseType) static List<TypeReference> getInterfaces(TypeReference type) static TypeReferencestatic ConversionTypegetNumericConversionType(TypeReference target, TypeReference source) static TypeDefinitiongetOutermostEnclosingType(TypeReference innerType) static TypeReferencestatic intstatic TypeReferencestatic TypeReferencestatic booleanhasImplicitNumericConversion(TypeReference target, TypeReference source) static booleanisAssignableFrom(TypeReference target, TypeReference source) static booleanisAssignableFrom(TypeReference target, TypeReference source, boolean allowUnchecked) static booleanisBytecodeCastAssignable(TypeReference target, TypeReference castType) static booleanisConvertible(TypeReference source, TypeReference target) static booleanisConvertible(TypeReference source, TypeReference target, boolean allowUnchecked) static booleanisEnclosedBy(TypeReference innerType, TypeReference outerType) static booleanstatic booleanstatic booleanisOverride(MethodDefinition method, MethodReference ancestorMethod) static booleanstatic booleanstatic booleanstatic booleanisSameType(TypeReference t, TypeReference s, boolean strict) static booleanisSubType(TypeReference type, TypeReference baseType) static booleanisSubType(TypeReference type, TypeReference baseType, boolean capture) static booleanisSubTypeNoCapture(TypeReference type, TypeReference baseType) static TypeReferencesubstituteGenericArguments(TypeReference inputType, MethodReference substitutionsProvider) static TypeReferencesubstituteGenericArguments(TypeReference inputType, TypeReference substitutionsProvider) static TypeReferencesubstituteGenericArguments(TypeReference inputType, Map<TypeReference, TypeReference> substitutionsProvider)
-
Constructor Details
-
MetadataHelper
public MetadataHelper()
-
-
Method Details
-
areGenericsSupported
-
getArrayRank
-
getOutermostEnclosingType
-
isEnclosedBy
-
canReferenceTypeVariablesOf
public static boolean canReferenceTypeVariablesOf(TypeReference declaringType, TypeReference referenceSite) -
findCommonSuperType
-
getConversionType
-
getConversionType
-
getConversionType
-
getNumericConversionType
@NotNull public static ConversionType getNumericConversionType(TypeReference target, TypeReference source) -
hasImplicitNumericConversion
-
isConvertible
-
isConvertible
public static boolean isConvertible(TypeReference source, TypeReference target, boolean allowUnchecked) -
isAssignableFrom
-
isAssignableFrom
public static boolean isAssignableFrom(TypeReference target, TypeReference source, boolean allowUnchecked) -
isSubType
-
isBytecodeCastAssignable
-
isPrimitiveBoxType
-
getBoxedTypeOrSelf
-
getUnderlyingPrimitiveTypeOrSelf
-
getDeclaredType
-
getBaseType
-
getInterfaces
-
asSubType
-
asSuper
-
getGenericSubTypeMappings
public static Map<TypeReference,TypeReference> getGenericSubTypeMappings(TypeReference type, TypeReference baseType) -
asMemberOf
-
asMemberOf
-
asMemberOf
-
substituteGenericArguments
public static TypeReference substituteGenericArguments(TypeReference inputType, TypeReference substitutionsProvider) -
substituteGenericArguments
public static TypeReference substituteGenericArguments(TypeReference inputType, MethodReference substitutionsProvider) -
substituteGenericArguments
public static TypeReference substituteGenericArguments(TypeReference inputType, Map<TypeReference, TypeReference> substitutionsProvider) -
findMethods
-
findMethods
public static List<MethodReference> findMethods(TypeReference type, Predicate<? super MethodReference> filter) -
findMethods
public static List<MethodReference> findMethods(TypeReference type, Predicate<? super MethodReference> filter, boolean includeBridgeMethods) -
findMethods
public static List<MethodReference> findMethods(TypeReference type, Predicate<? super MethodReference> filter, boolean includeBridgeMethods, boolean includeOverriddenMethods) -
isOverloadCheckingRequired
-
isInterface
-
getLowerBound
-
getUpperBound
-
getElementType
-
getSuperType
-
isSubTypeNoCapture
-
isSubType
-
adapt
-
containsType
Check iftcontainss.TcontainsSif: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)- Parameters:
t- a types- a type
-
isSameType
-
isSameType
-
areSameTypes
public static boolean areSameTypes(List<? extends TypeReference> t, List<? extends TypeReference> s) -
areSameTypes
public static boolean areSameTypes(List<? extends TypeReference> t, List<? extends TypeReference> s, boolean strict) -
isRawType
-
getUnboundGenericParameterCount
-
eraseRecursive
-
eraseRecursive
-
erase
-
erase
-
erase
-
isOverride
-