Package com.strobel.reflection
Class Helper
- java.lang.Object
-
- com.strobel.reflection.Helper
-
final class Helper extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classHelper.Adapterstatic classHelper.AdaptFailure(package private) static classHelper.TypePair
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description privateHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadapt(Type<?> source, Type<?> target, ListBuffer<Type<?>> from, ListBuffer<Type<?>> to)private static voidadaptSelf(Type<?> t, ListBuffer<Type<?>> from, ListBuffer<Type<?>> to)static booleanareSameTypes(TypeList ts, TypeList tp)private static Type<?>arraySuperType()static MemberInfoasMemberOf(Type<?> type, MemberInfo member)static Type<?>asOuterSuper(Type<?> t, Type<?> type)static Type<?>asSuper(Type<?> type, Type<?> other)static Type<?>capture(Type<?> t)static ImmutableList<Type<?>>closure(Type<?> t)private static ImmutableList<Type<?>>closureMin(ImmutableList<Type<?>> cl)(package private) static booleancontainsType(ImmutableList<Type<?>> ts, ImmutableList<Type<?>> ss)(package private) static booleancontainsType(Type<?> t, Type<?> p)(package private) static booleancontainsType(TypeList ts, TypeList ss)(package private) static booleancontainsTypeEquivalent(ImmutableList<Type<?>> ts, ImmutableList<Type<?>> tp)private static booleancontainsTypeEquivalent(Type<?> t, Type<?> p)(package private) static booleancontainsTypeEquivalent(TypeList ts, TypeList tp)static booleancovariantReturnType(Type<?> t, Type<?> s)static Type<?>elementType(Type<?> t)static Type<?>erasure(Type<?> t)private static Type<?>erasure(Type<?> t, boolean recurse)static TypeListerasure(TypeList ts)static Type<?>erasureRecursive(Type<?> t)static TypeListerasureRecursive(TypeList ts)private static TypeListfreshTypeVariables(TypeList types)static Type<?>glb(Type<?> t, Type<?> p)static inthashCode(Type<?> t)static booleanhasSameArgs(MethodInfo t, MethodInfo p)static booleanhasSameArgs(TypeList t, TypeList p)static booleaninSamePackage(Type<?> t1, Type<?> t2)static ImmutableList<Type<?>>insert(ImmutableList<Type<?>> cl, Type<?> t)static ImmutableList<Type<?>>interfaces(Type<?> type)static booleanisAssignable(Type<?> sourceType, Type<?> targetType)static booleanisCaptureOf(Type<?> p, Type<?> t)static booleanisConvertible(Type<?> sourceType, Type<?> targetType)static booleanisInheritedIn(Type<?> site, MemberInfo member)private static booleanisOverridableIn(MethodInfo method, Type<?> origin)static booleanisReifiable(Type<?> t)static booleanisSameType(Type<?> t, Type<?> p)static booleanisSameWildcard(Type<?> t, Type<?> p)static booleanisSubSignature(MethodInfo t, MethodInfo p)static booleanisSubtype(Type<?> t, Type<?> p)static booleanisSubtype(Type<?> t, Type<?> p, boolean capture)static booleanisSubtypeNoCapture(Type<?> t, Type<?> p)static booleanisSubtypeUnchecked(Type<?> t, Type<?> s)static booleanisSuperType(Type<?> type, Type<?> other)static Type<?>lowerBound(Type<?> t)static TypeListmap(TypeList ts, TypeMapping f)static booleanoverrides(MethodBase method, MethodBase other, boolean checkResult)static booleanoverrides(MethodInfo baseMethod, MethodInfo ancestorMethod)static booleanoverrides(MethodInfo method, MethodInfo other, boolean checkResult)static booleanprecedes(Type<?> origin, Type<?> other)static intrank(Type<?> t)static booleanresultSubtype(MethodInfo t, MethodInfo s)static booleanreturnTypeSubstitutable(MethodInfo r1, MethodInfo r2)static Type<?>substitute(Type<?> type, ImmutableList<Type<?>> genericParameters, ImmutableList<Type<?>> typeArguments)static Type<?>substitute(Type<?> type, TypeBindings bindings)static Type<?>substitute(Type<?> type, TypeList genericParameters, TypeList typeArguments)static Type<?>superType(Type<?> t)static ImmutableList<Type<?>>union(ImmutableList<Type<?>> cl1, ImmutableList<Type<?>> cl2)static Type<?>upperBound(Type<?> t)
-
-
-
Field Detail
-
ErasureFunctor
private static final TypeMapping ErasureFunctor
-
ErasureRecursiveFunctor
private static final TypeMapping ErasureRecursiveFunctor
-
SubstitutingBinder
private static final TypeBinder SubstitutingBinder
-
AsSuperVisitor
private static final TypeVisitor<Type<?>,Type<?>> AsSuperVisitor
-
IsSameTypeRelation
private static final TypeRelation IsSameTypeRelation
-
UpperBoundVisitor
private static final TypeMapper<java.lang.Void> UpperBoundVisitor
-
LowerBoundVisitor
private static final TypeMapper<java.lang.Void> LowerBoundVisitor
-
ErasureVisitor
private static final TypeMapper<java.lang.Boolean> ErasureVisitor
-
ContainsTypeRelation
private static final TypeRelation ContainsTypeRelation
-
InterfacesVisitor
private static final SimpleVisitor<ImmutableList<Type<?>>,ImmutableList<Type<?>>> InterfacesVisitor
-
SuperTypeVisitor
private static final UnaryTypeVisitor<Type<?>> SuperTypeVisitor
-
IsSubtypeRelation
private static final TypeRelation IsSubtypeRelation
-
HashCodeVisitor
private static final UnaryTypeVisitor<java.lang.Integer> HashCodeVisitor
-
IsReifiableVisitor
private static final UnaryTypeVisitor<java.lang.Boolean> IsReifiableVisitor
-
_arraySuperType
private static Type<?> _arraySuperType
-
typeBinder
private static final TypeBinder typeBinder
-
asMemberOfVisitor
private static final SimpleVisitor<MemberInfo,MemberInfo> asMemberOfVisitor
-
closureCache
private static final java.util.Map<Type<?>,ImmutableList<Type<?>>> closureCache
-
-
Method Detail
-
overrides
public static boolean overrides(MethodInfo baseMethod, MethodInfo ancestorMethod)
-
isOverridableIn
private static boolean isOverridableIn(MethodInfo method, Type<?> origin)
-
overrides
public static boolean overrides(MethodBase method, MethodBase other, boolean checkResult)
-
overrides
public static boolean overrides(MethodInfo method, MethodInfo other, boolean checkResult)
-
resultSubtype
public static boolean resultSubtype(MethodInfo t, MethodInfo s)
-
returnTypeSubstitutable
public static boolean returnTypeSubstitutable(MethodInfo r1, MethodInfo r2)
-
isSubSignature
public static boolean isSubSignature(MethodInfo t, MethodInfo p)
-
hasSameArgs
public static boolean hasSameArgs(MethodInfo t, MethodInfo p)
-
containsType
static boolean containsType(ImmutableList<Type<?>> ts, ImmutableList<Type<?>> ss)
-
containsTypeEquivalent
static boolean containsTypeEquivalent(ImmutableList<Type<?>> ts, ImmutableList<Type<?>> tp)
-
map
public static TypeList map(TypeList ts, TypeMapping f)
-
substitute
public static Type<?> substitute(Type<?> type, ImmutableList<Type<?>> genericParameters, ImmutableList<Type<?>> typeArguments)
-
substitute
public static Type<?> substitute(Type<?> type, TypeList genericParameters, TypeList typeArguments)
-
substitute
public static Type<?> substitute(Type<?> type, TypeBindings bindings)
-
interfaces
public static ImmutableList<Type<?>> interfaces(Type<?> type)
-
rank
public static int rank(Type<?> t)
-
union
public static ImmutableList<Type<?>> union(ImmutableList<Type<?>> cl1, ImmutableList<Type<?>> cl2)
-
isInheritedIn
public static boolean isInheritedIn(Type<?> site, MemberInfo member)
-
adapt
public static void adapt(Type<?> source, Type<?> target, ListBuffer<Type<?>> from, ListBuffer<Type<?>> to) throws Helper.AdaptFailure
- Throws:
Helper.AdaptFailure
-
adaptSelf
private static void adaptSelf(Type<?> t, ListBuffer<Type<?>> from, ListBuffer<Type<?>> to)
-
hashCode
public static int hashCode(Type<?> t)
-
isReifiable
public static boolean isReifiable(Type<?> t)
-
arraySuperType
private static Type<?> arraySuperType()
-
asMemberOf
public static MemberInfo asMemberOf(Type<?> type, MemberInfo member)
-
insert
public static ImmutableList<Type<?>> insert(ImmutableList<Type<?>> cl, Type<?> t)
-
closureMin
private static ImmutableList<Type<?>> closureMin(ImmutableList<Type<?>> cl)
-
closure
public static ImmutableList<Type<?>> closure(Type<?> t)
-
-