Modifier and Type | Method and Description |
---|---|
static GenericArrayType |
genericArrayType(Type componentType)
Creates a generic array type for the specified component type.
|
static WildcardType |
lowerBoundedWildcardType(Type lowerBound)
Creates a wildcard type with the specified lower bound.
|
static ParameterizedType |
parameterizedType(Class<?> rawType,
Type... actualTypeArguments)
Creates a parameterized type for the specified raw type and actual type arguments.
|
static <D extends GenericDeclaration> |
typeVariable(D declaration,
String name,
Type... bounds)
Creates a type variable for the specified declaration, name and bounds.
|
static WildcardType |
unboundedWildcardType()
Creates an unbounded wildcard type.
|
static WildcardType |
upperBoundedWildcardType(Type upperBound)
Creates a wildcard type with the specified upper bound.
|
static Type |
valueOf(String typeName)
Returns a type that corresponds to the specified string.
|
static Type |
valueOf(String typeName,
Set<String> imports)
Returns a type that corresponds to the specified string using the specified import context.
|
public static <D extends GenericDeclaration> TypeVariable<D> typeVariable(D declaration, String name, Type... bounds)
D
- the type of generic declaration that declared the type variabledeclaration
- the generic declaration that declared the type variablename
- the name of the type variablebounds
- the upper bounds of the type variablepublic static GenericArrayType genericArrayType(Type componentType)
componentType
- the component typepublic static ParameterizedType parameterizedType(Class<?> rawType, Type... actualTypeArguments)
rawType
- the raw typeactualTypeArguments
- the actual type argumentsMalformedParameterizedTypeException
- if the number of actual type arguments differs from those defined on the raw typepublic static WildcardType unboundedWildcardType()
public static WildcardType upperBoundedWildcardType(Type upperBound)
upperBound
- the upper bound typepublic static WildcardType lowerBoundedWildcardType(Type lowerBound)
lowerBound
- the lower bound typepublic static Type valueOf(String typeName)
typeName
- the string to be parsedpublic static Type valueOf(String typeName, Set<String> imports)
typeName
- the string to be parsedimports
- the fully qualified class names to use when an unqualified class name is encounteredIllegalArgumentException
- if the import context contains duplicate entries for an unqualified class nameCopyright © 2008–2015. All rights reserved.