Package org.jboss.weld.util
Class Types
java.lang.Object
org.jboss.weld.util.Types
Utility class for Types
- Author:
- Pete Muir
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>boxedClass(Class<?> type) static TypeGets the boxed type of a classbuildClassNameMap(Iterable<C> set) Builds (class name -> class) map for given classes.static booleancontainsTypeVariable(Type type) static TypegetArrayComponentType(Type type) Determines the component type for a given array type.static TypegetCanonicalType(Class<?> clazz) Returns a canonical type for a given class.static TypegetCanonicalType(Type type) static Class<?>[]getRawTypes(Type[] types) getRawTypes(Set<Type> types) static Stringstatic booleanisActualType(Type type) Determines whether the given type is an actual type.static booleanDetermines whether the given type is an array type.static booleanDetermines whether the given array only contains unbounded type variables or Object.class.static booleanisIllegalBeanType(Type beanType) static booleanisMoreSpecific(Type type1, Type type2) static booleanisRawGenericType(Type type)
-
Field Details
-
TYPE_TO_CLASS_FUNCTION
-
-
Method Details
-
boxedType
Gets the boxed type of a class- Parameters:
type- The type- Returns:
- The boxed type
-
boxedClass
-
getTypeId
-
getCanonicalType
Returns a canonical type for a given class. If the class is a raw type of a parameterized class, the matchingParameterizedType(with unresolved type variables) is resolved. If the class is an array then the component type of the array is canonicalized Otherwise, the class is returned.- Returns:
-
getCanonicalType
- Parameters:
type-- Returns:
-
containsTypeVariable
-
getRawTypes
-
getRawTypes
-
buildClassNameMap
Builds (class name -> class) map for given classes. -
isActualType
Determines whether the given type is an actual type. A type is considered actual if it is a raw type, a parameterized type or an array type.- Parameters:
type- the given type- Returns:
- true if and only if the given type is an actual type
-
isArray
Determines whether the given type is an array type.- Parameters:
type- the given type- Returns:
- true if the given type is a subclass of java.lang.Class or implements GenericArrayType
-
getArrayComponentType
Determines the component type for a given array type.- Parameters:
type- the given array type- Returns:
- the component type of a given array type
-
isArrayOfUnboundedTypeVariablesOrObjects
Determines whether the given array only contains unbounded type variables or Object.class.- Parameters:
types- the given array of types- Returns:
- true if and only if the given array only contains unbounded type variables or Object.class
-
isRawGenericType
-
isIllegalBeanType
- Parameters:
beanType-- Returns:
trueif the given type is not a legal bean type,falseotherwise
-
isMoreSpecific
- Parameters:
type1-type2-- Returns:
trueif the first type is more specific than the second type (is a subtype of),falseotherwise
-