public class TypeChecker
extends java.lang.Object
Constructor and Description |
---|
TypeChecker() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.reflect.Type |
getArrayType(java.lang.reflect.Type type)
An array type can be a class that is an array
or a GenericArrayType
|
private static java.lang.Class<?> |
getBound(java.lang.reflect.Type[] bounds) |
private static java.lang.reflect.TypeVariable<?> |
getTypeVariable(java.lang.reflect.Type type) |
private static java.lang.reflect.WildcardType |
getWildcard(java.lang.reflect.Type type) |
private static boolean |
isActualType(java.lang.reflect.Type type)
An actual type is either a Class or a ParameterizedType
|
private static boolean |
isActualTypeVariableSafe(java.lang.Class<?> actual,
java.lang.reflect.TypeVariable<?> tv) |
private static boolean |
isArrayType(java.lang.reflect.Type type)
An array type can be a class that is an array
or a GenericArrayType
|
static boolean |
isRawTypeSafe(java.lang.reflect.Type requiredType,
java.lang.reflect.Type beanType)
Returns true if the given requiredType is safely assignable
from the given beanType.
|
private static boolean |
isTypeVariable(java.lang.reflect.Type type) |
private static boolean |
isTypeVariableTypeVariableSafe(java.lang.reflect.TypeVariable<?> rtv,
java.lang.reflect.TypeVariable<?> btv) |
private static boolean |
isWildcard(java.lang.reflect.Type type) |
private static boolean |
isWildcardActualSafe(java.lang.reflect.WildcardType wildcard,
java.lang.Class<?> actual) |
private static boolean |
isWildcardTypeVariableSafe(java.lang.reflect.WildcardType wildcard,
java.lang.reflect.TypeVariable<?> tv) |
public static boolean isRawTypeSafe(java.lang.reflect.Type requiredType, java.lang.reflect.Type beanType)
requiredType = beanType
without any cast. It should be noted that this
checker is using the CDI rules (as stated in CDI version 1.1
in sectionrequiredType
- The type being assigned intobeanType
- the type being assignedprivate static boolean isTypeVariableTypeVariableSafe(java.lang.reflect.TypeVariable<?> rtv, java.lang.reflect.TypeVariable<?> btv)
private static boolean isActualTypeVariableSafe(java.lang.Class<?> actual, java.lang.reflect.TypeVariable<?> tv)
private static boolean isWildcardTypeVariableSafe(java.lang.reflect.WildcardType wildcard, java.lang.reflect.TypeVariable<?> tv)
private static java.lang.Class<?> getBound(java.lang.reflect.Type[] bounds)
private static boolean isWildcardActualSafe(java.lang.reflect.WildcardType wildcard, java.lang.Class<?> actual)
private static java.lang.reflect.WildcardType getWildcard(java.lang.reflect.Type type)
private static java.lang.reflect.TypeVariable<?> getTypeVariable(java.lang.reflect.Type type)
private static boolean isWildcard(java.lang.reflect.Type type)
private static boolean isTypeVariable(java.lang.reflect.Type type)
private static boolean isActualType(java.lang.reflect.Type type)
type
- The type to testprivate static boolean isArrayType(java.lang.reflect.Type type)
type
- The type to testprivate static java.lang.reflect.Type getArrayType(java.lang.reflect.Type type)
type
- The type to test