Package com.strobel.reflection
Class Type<T>
java.lang.Object
com.strobel.reflection.MemberInfo
com.strobel.reflection.Type<T>
- All Implemented Interfaces:
AnnotatedElement
,Type
- Direct Known Subclasses:
ArrayType
,BottomType
,CapturedType
,CompoundType
,ErasedType
,GenericParameter
,GenericParameterBuilder
,GenericType
,NullType
,PrimitiveType
,ReflectedType
,RuntimeType
,TypeBuilder
,TypeBuilderInstantiation
,WildcardType
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RuntimeTypeCache
<T> private ErasedType
<T> private TypeList
static final Type
<?> Deprecated.(package private) static final TypeCache
(package private) static final Object
static final Binder
protected static final Set
<BindingFlags> static final char
protected static final ConstructorInfo[]
protected static final FieldInfo[]
protected static final MemberInfo[]
protected static final MethodInfo[]
protected static final Object[]
protected static final String[]
static final Type<?>[]
static final MemberFilter
static final MemberFilter
static final MemberFilter
static final MemberFilter
static final Type
<?> Deprecated.UsenullType()
instead.(package private) static final Type<?>[]
(package private) static final Resolver
(package private) static final TypeBinder
static final Missing
Fields inherited from class com.strobel.reflection.MemberInfo
EMPTY_ANNOTATIONS, ENUM_MODIFIER, VARARGS_MODIFIER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuilder
protected StringBuilder
_appendClassName
(StringBuilder sb, boolean fullName, boolean dottedName) protected StringBuilder
protected StringBuilder
<P,
R> R accept
(TypeVisitor<P, R> visitor, P parameter) Type
<?> asSuperTypeOf
(Type<?> type) static Type
<?> boolean
containsGenericParameter
(Type<?> genericParameter) boolean
private boolean
filterApplyCore
(MemberInfo member, Set<BindingFlags> bindingFlags, boolean isPublic, boolean isPackagePrivate, boolean isStatic, String name, boolean prefixLookup) private boolean
filterApplyPrefixLookup
(MemberInfo method, String name, boolean ignoreCase) private boolean
filterApplyType
(Type<?> type, Set<BindingFlags> bindingFlags, String name, boolean prefixLookup) (package private) boolean
filterMethodBase
(MethodBase method, Set<BindingFlags> methodFlags, Set<BindingFlags> bindingFlags, CallingConvention callingConventions, Type<?>... argumentTypes) (package private) static Set
<BindingFlags> filterPreCalculate
(boolean isPublic, boolean isInherited, boolean isStatic) MemberList
<? extends MemberInfo> findMembers
(Set<MemberType> memberTypes, Set<BindingFlags> bindingAttr, MemberFilter filter, Object filterCriteria) static Type
<?> static Type
<?> <A extends Annotation>
AgetAnnotation
(Class<A> annotationClass) (package private) final RuntimeTypeCache
<T> getCache()
protected String
protected String
final ConstructorInfo
getConstructor
(Type<?>... parameterTypes) getConstructor
(Set<BindingFlags> bindingFlags, CallingConvention callingConvention, Type<?>... parameterTypes) final ConstructorInfo
getConstructor
(Set<BindingFlags> bindingFlags, Type<?>... parameterTypes) final ConstructorList
getConstructors
(Set<BindingFlags> bindingFlags) protected ConstructorList
protected FieldList
protected MethodList
protected TypeList
Type
<?> Object[]
String[]
final Type
<?> Type
<?> final FieldInfo
getField
(String name, Set<BindingFlags> bindingFlags) private FieldInfo[]
getFieldCandidates
(String name, Set<BindingFlags> bindingFlags, boolean allowPrefixLookup) final FieldList
getFields
(Set<BindingFlags> bindingFlags) private static Type.FilterOptions
getFilterOptions
(String name, Set<BindingFlags> bindingFlags, boolean allowPrefixLookup) int
Method that returns full generic signature of the type; suitable as signature for things like ASM package.Type
<?> getKind()
final MemberList
<?> final MemberList
<?> getMember
(String name, MemberType memberType, MemberType... memberTypes) MemberList
<?> getMember
(String name, Set<BindingFlags> bindingFlags, Set<MemberType> memberTypes) final MemberList
<?> final MemberList
<?> getMembers
(MemberType memberType, MemberType... memberTypes) final MemberList
<?> getMembers
(Set<BindingFlags> bindingFlags) final MemberList
<?> getMembers
(Set<BindingFlags> bindingFlags, MemberType memberType, MemberType... memberTypes) MemberList
<?> getMembers
(Set<BindingFlags> bindingFlags, Set<MemberType> memberTypes) final MemberList
<?> getMembersOfType
(Set<MemberType> memberTypes) final MethodInfo
getMethod
(String name, Set<BindingFlags> bindingFlags, CallingConvention callingConvention, Type<?>... parameterTypes) final MethodInfo
getMethod
(String name, Set<BindingFlags> bindingFlags, Type<?>... parameterTypes) private <M extends MethodBase>
M[]getMethodBaseCandidates
(MemberType type, String name, Set<BindingFlags> bindingFlags, CallingConvention callingConvention, Type<?>[] parameterTypes, boolean allowPrefixLookup) final MethodList
final MethodList
getMethods
(Set<BindingFlags> bindingFlags) getMethods
(Set<BindingFlags> bindingFlags, CallingConvention callingConvention) (package private) Type
<?> getMostSpecificType
(Type<?> t1, Type<?> t2) getName()
final Type
<?> getNestedType
(String fullName) Type
<?> getNestedType
(String fullName, Set<BindingFlags> bindingFlags) private Type<?>[]
getNestedTypeCandidates
(String fullName, Set<BindingFlags> bindingFlags, boolean allowPrefixLookup) final TypeList
getNestedTypes
(Set<BindingFlags> bindingFlags) (package private) Type
<?> Type
<?> static <T> Type
<T> getType
(T object) protected TypeBindings
final Type
<?> protected Type
<?> boolean
boolean
int
hashCode()
boolean
boolean
implementsInterface
(Type<?> interfaceType) protected void
Invalidate any cached type/member information.final boolean
boolean
isAnnotationPresent
(Class<? extends Annotation> annotationClass) boolean
isArray()
boolean
isAssignableFrom
(Type<?> type) boolean
final boolean
isClass()
boolean
final boolean
isEnum()
final boolean
boolean
isEquivalentTo
(Type<?> other) boolean
boolean
boolean
boolean
isInstance
(Object o) final boolean
boolean
boolean
isNested()
boolean
boolean
boolean
isSubTypeOf
(Type<?> type) boolean
boolean
boolean
boolean
static TypeList
static TypeList
static TypeList
static <T> Type
<T[]> makeArrayType
(Type<T> elementType) static Type
<?> makeCompoundType
(Type<?> baseType, TypeList interfaces) static Type
<?> makeCompoundType
(TypeList bounds) private static <T> Type
<T> makeCompoundTypeCore
(Type<T> baseType, TypeList interfaces) static <T> Type
<? extends T> makeExtendsWildcard
(Type<T> bound) makeGenericType
(Type<?>... typeArguments) makeGenericType
(TypeList typeArguments) protected Type
<?> makeGenericTypeCore
(TypeList typeArguments) static <T> Type
<? super T> makeSuperWildcard
(Type<T> bound) static WildcardType
<?> newInstance
(Object... arguments) static Type
<?> nullType()
static <T> Type
<T> (package private) static <T> Type
<T> private static Type
<?> resolveClassType
(Class<?> actualClass) protected static Type
<?> substitute
(Type<?> type, TypeBindings typeBindings) toString()
(package private) static Type
<?> static WildcardType
<?> Methods inherited from class com.strobel.reflection.MemberInfo
emptyAnnotations, equals, getAnnotationsByType, getBriefDescription, getDeclaredAnnotation, getDeclaredAnnotationsByType, getDeclaringType, getDescription, getErasedDescription, getErasedSignature, getModifiers, getReflectedType, getSignature, getSimpleDescription, isFinal, isNonPublic, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.reflect.Type
getTypeName
-
Field Details
-
DefaultBinder
-
Delimiter
public static final char Delimiter- See Also:
-
Value
-
EmptyTypes
-
Bottom
Deprecated.UsebottomType()
instead. -
NullType
Deprecated.UsenullType()
instead. -
EmptyObjects
-
EmptyStrings
-
EmptyMethods
-
EmptyConstructors
-
EmptyFields
-
EmptyMembers
-
DefaultLookup
-
_interfaces
-
_erasedType
-
CACHE_LOCK
-
CACHE
-
RESOLVER
-
PRIMITIVE_TYPES
-
TYPE_BINDER
-
_cache
-
FilterNameIgnoreCase
-
FilterName
-
FilterRawMember
-
FilterMethodOverride
-
-
Constructor Details
-
Type
protected Type()
-
-
Method Details
-
bottomType
-
nullType
-
unboundedWildcard
-
getMemberType
- Specified by:
getMemberType
in classMemberInfo
-
isNested
public boolean isNested() -
isLocalClass
public boolean isLocalClass() -
isVisible
public boolean isVisible() -
isClass
public final boolean isClass() -
isInterface
public final boolean isInterface() -
isEnum
public final boolean isEnum() -
isAbstract
public final boolean isAbstract() -
isArray
public boolean isArray() -
isGenericType
public boolean isGenericType() -
isGenericTypeDefinition
public boolean isGenericTypeDefinition() -
isRawType
public boolean isRawType() -
isGenericParameter
public boolean isGenericParameter() -
isPrimitive
public boolean isPrimitive() -
hasElementType
public boolean hasElementType() -
getKind
-
getBaseType
-
getInterfaces
-
getExplicitInterfaces
-
getErasedClass
-
newInstance
-
getDeclaringMethod
-
getUnderlyingType
-
getUnderlyingTypeCore
-
getElementType
-
getGenericParameterPosition
public int getGenericParameterPosition() -
getTypeBindings
-
getTypeArguments
-
getGenericTypeParameters
-
getGenericTypeDefinition
-
containsGenericParameters
public boolean containsGenericParameters() -
containsGenericParameter
-
isBoundedType
public boolean isBoundedType() -
isUnbounded
public boolean isUnbounded() -
hasExtendsBound
public boolean hasExtendsBound() -
hasSuperBound
public boolean hasSuperBound() -
getExtendsBound
-
getSuperBound
-
isEquivalentTo
- Overrides:
isEquivalentTo
in classMemberInfo
-
isEquivalentTo
-
isSubTypeOf
-
isInstance
-
implementsInterface
-
isAssignableFrom
-
getPackage
-
isCompoundType
public boolean isCompoundType() -
isWildcardType
public boolean isWildcardType() -
isSynthetic
public boolean isSynthetic() -
accept
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotatedElement
- Overrides:
getAnnotation
in classMemberInfo
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatedElement
- Overrides:
getAnnotations
in classMemberInfo
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotations
in interfaceAnnotatedElement
- Overrides:
getDeclaredAnnotations
in classMemberInfo
-
isAnnotationPresent
- Specified by:
isAnnotationPresent
in interfaceAnnotatedElement
- Overrides:
isAnnotationPresent
in classMemberInfo
-
getMember
-
getMember
-
getMember
public MemberList<?> getMember(String name, Set<BindingFlags> bindingFlags, Set<MemberType> memberTypes) -
getField
-
getField
-
getMethod
-
getMethod
public final MethodInfo getMethod(String name, Set<BindingFlags> bindingFlags, Type<?>... parameterTypes) -
getMethod
public MethodInfo getMethod(String name, Set<BindingFlags> bindingFlags, CallingConvention callingConvention, Type<?>... parameterTypes) -
getConstructor
-
getConstructor
public final ConstructorInfo getConstructor(Set<BindingFlags> bindingFlags, Type<?>... parameterTypes) -
getConstructor
public ConstructorInfo getConstructor(Set<BindingFlags> bindingFlags, CallingConvention callingConvention, Type<?>... parameterTypes) -
getMembers
-
getMembersOfType
-
getMembers
-
getMembers
-
getMembers
public final MemberList<?> getMembers(Set<BindingFlags> bindingFlags, MemberType memberType, MemberType... memberTypes) -
getMembers
-
findMembers
public MemberList<? extends MemberInfo> findMembers(Set<MemberType> memberTypes, Set<BindingFlags> bindingAttr, MemberFilter filter, Object filterCriteria) -
getFields
-
getFields
-
getMethods
-
getMethods
-
getMethods
-
getConstructors
-
getConstructors
-
getNestedTypes
-
getNestedTypes
-
getNestedType
-
getNestedType
-
getEnumConstants
-
getEnumNames
-
hashCode
public int hashCode()- Overrides:
hashCode
in classMemberInfo
-
makeArrayType
-
createArrayType
-
makeGenericType
-
makeGenericType
-
getErasedType
-
makeGenericTypeCore
-
substitute
-
asSuperTypeOf
-
getRootElementType
Type<?> getRootElementType() -
getMostSpecificType
-
toString
- Overrides:
toString
in classMemberInfo
-
getName
- Specified by:
getName
in classMemberInfo
-
getClassFullName
-
getClassSimpleName
-
getShortName
-
getFullName
-
getInternalName
-
getGenericSignature
Method that returns full generic signature of the type; suitable as signature for things like ASM package. -
appendBriefDescription
- Specified by:
appendBriefDescription
in classMemberInfo
-
appendSimpleDescription
- Specified by:
appendSimpleDescription
in classMemberInfo
-
appendErasedDescription
- Specified by:
appendErasedDescription
in classMemberInfo
-
appendDescription
- Specified by:
appendDescription
in classMemberInfo
-
appendSignature
- Specified by:
appendSignature
in classMemberInfo
-
appendGenericSignature
- Overrides:
appendGenericSignature
in classMemberInfo
-
invalidateCaches
protected void invalidateCaches()Description copied from class:MemberInfo
Invalidate any cached type/member information. This is not guaranteed to be thread-safe, should only be called when a partially constructed type/member definition changes (e.g., a TypeBuilder, MethodBuilder, etc.).- Overrides:
invalidateCaches
in classMemberInfo
-
appendErasedSignature
- Specified by:
appendErasedSignature
in classMemberInfo
-
_appendClassSignature
-
_appendErasedClassSignature
-
_appendClassDescription
-
_appendClassName
-
of
-
forName
-
forName
-
resolveClassType
-
getType
-
of
-
tryFind
-
makeExtendsWildcard
-
makeSuperWildcard
-
makeWildcard
-
makeArrayType
-
makeCompoundType
-
makeCompoundType
-
makeCompoundTypeCore
-
list
-
list
-
list
-
getCache
-
getDeclaredConstructors
-
getDeclaredMethods
-
getDeclaredFields
-
getDeclaredTypes
-
getMethodBaseCandidates
private <M extends MethodBase> M[] getMethodBaseCandidates(MemberType type, String name, Set<BindingFlags> bindingFlags, CallingConvention callingConvention, Type<?>[] parameterTypes, boolean allowPrefixLookup) -
getFieldCandidates
private FieldInfo[] getFieldCandidates(String name, Set<BindingFlags> bindingFlags, boolean allowPrefixLookup) -
getNestedTypeCandidates
private Type<?>[] getNestedTypeCandidates(String fullName, Set<BindingFlags> bindingFlags, boolean allowPrefixLookup) -
filterMethodBase
boolean filterMethodBase(MethodBase method, Set<BindingFlags> methodFlags, Set<BindingFlags> bindingFlags, CallingConvention callingConventions, Type<?>... argumentTypes) -
filterApplyType
private boolean filterApplyType(Type<?> type, Set<BindingFlags> bindingFlags, String name, boolean prefixLookup) -
filterApplyCore
private boolean filterApplyCore(MemberInfo member, Set<BindingFlags> bindingFlags, boolean isPublic, boolean isPackagePrivate, boolean isStatic, String name, boolean prefixLookup) -
filterApplyPrefixLookup
-
getFilterOptions
private static Type.FilterOptions getFilterOptions(String name, Set<BindingFlags> bindingFlags, boolean allowPrefixLookup) -
filterPreCalculate
static Set<BindingFlags> filterPreCalculate(boolean isPublic, boolean isInherited, boolean isStatic)
-
bottomType()
instead.