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 class
Helper.Adapter
static class
Helper.AdaptFailure
(package private) static class
Helper.TypePair
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description private
Helper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
adapt(Type<?> source, Type<?> target, ListBuffer<Type<?>> from, ListBuffer<Type<?>> to)
private static void
adaptSelf(Type<?> t, ListBuffer<Type<?>> from, ListBuffer<Type<?>> to)
static boolean
areSameTypes(TypeList ts, TypeList tp)
private static Type<?>
arraySuperType()
static MemberInfo
asMemberOf(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 boolean
containsType(ImmutableList<Type<?>> ts, ImmutableList<Type<?>> ss)
(package private) static boolean
containsType(Type<?> t, Type<?> p)
(package private) static boolean
containsType(TypeList ts, TypeList ss)
(package private) static boolean
containsTypeEquivalent(ImmutableList<Type<?>> ts, ImmutableList<Type<?>> tp)
private static boolean
containsTypeEquivalent(Type<?> t, Type<?> p)
(package private) static boolean
containsTypeEquivalent(TypeList ts, TypeList tp)
static boolean
covariantReturnType(Type<?> t, Type<?> s)
static Type<?>
elementType(Type<?> t)
static Type<?>
erasure(Type<?> t)
private static Type<?>
erasure(Type<?> t, boolean recurse)
static TypeList
erasure(TypeList ts)
static Type<?>
erasureRecursive(Type<?> t)
static TypeList
erasureRecursive(TypeList ts)
private static TypeList
freshTypeVariables(TypeList types)
static Type<?>
glb(Type<?> t, Type<?> p)
static int
hashCode(Type<?> t)
static boolean
hasSameArgs(MethodInfo t, MethodInfo p)
static boolean
hasSameArgs(TypeList t, TypeList p)
static boolean
inSamePackage(Type<?> t1, Type<?> t2)
static ImmutableList<Type<?>>
insert(ImmutableList<Type<?>> cl, Type<?> t)
static ImmutableList<Type<?>>
interfaces(Type<?> type)
static boolean
isAssignable(Type<?> sourceType, Type<?> targetType)
static boolean
isCaptureOf(Type<?> p, Type<?> t)
static boolean
isConvertible(Type<?> sourceType, Type<?> targetType)
static boolean
isInheritedIn(Type<?> site, MemberInfo member)
private static boolean
isOverridableIn(MethodInfo method, Type<?> origin)
static boolean
isReifiable(Type<?> t)
static boolean
isSameType(Type<?> t, Type<?> p)
static boolean
isSameWildcard(Type<?> t, Type<?> p)
static boolean
isSubSignature(MethodInfo t, MethodInfo p)
static boolean
isSubtype(Type<?> t, Type<?> p)
static boolean
isSubtype(Type<?> t, Type<?> p, boolean capture)
static boolean
isSubtypeNoCapture(Type<?> t, Type<?> p)
static boolean
isSubtypeUnchecked(Type<?> t, Type<?> s)
static boolean
isSuperType(Type<?> type, Type<?> other)
static Type<?>
lowerBound(Type<?> t)
static TypeList
map(TypeList ts, TypeMapping f)
static boolean
overrides(MethodBase method, MethodBase other, boolean checkResult)
static boolean
overrides(MethodInfo baseMethod, MethodInfo ancestorMethod)
static boolean
overrides(MethodInfo method, MethodInfo other, boolean checkResult)
static boolean
precedes(Type<?> origin, Type<?> other)
static int
rank(Type<?> t)
static boolean
resultSubtype(MethodInfo t, MethodInfo s)
static boolean
returnTypeSubstitutable(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)
-
-