java.lang.reflect
public interface TypeVariable<T extends GenericDeclaration> extends Type
This is a common interface for all type variables provided by the Java language. Instances are created the first time a type variable is needed by one of the reflective methods declared in this package.
Creating a type variable requires resolving the appropriate type.
This may involve resolving other classes as a side effect (e.g.
if the type is nested inside other classes). Creation should not
involve resolving the bounds. Repeated creation has no effect; an
equivalent instance is returned. Caching is not required, but all
instances must be equal()
to each other.
Since: 1.5
Method Summary | |
---|---|
Type[] | getBounds()
Returns an array of Type objects which represent the upper
bounds of this type variable. |
T | getGenericDeclaration()
Returns a representation of the declaration used to declare this
type variable.
|
String | getName()
Returns the name of the type variable, as written in the source
code.
|
Type
objects which represent the upper
bounds of this type variable. There is always a default bound of
Object
. Any ParameterizedType
s will be
created as necessary, and other types resolved.
Returns: an array of Type
objects representing the upper
bounds.
Throws: TypeNotPresentException if any of the bounds refer to a
non-existant type. MalformedParameterizedTypeException if the creation of a
ParameterizedType
fails.
Returns: the GenericDeclaration
object for this type
variable.
Returns: the name of the type variable.