repository.grepcode.com$java$root@jdk$openjdk@6-b14
repository.grepcode.com$java$root@jdk$openjdk@6-b14@java$lang$reflect$GenericDeclaration.java
file
oh
o
[]
I'm using reflection to walk the field members of a class and I need to know for List<> subclasses, what the generic type parameters are.
Given a field that has a type that is a subclass of List, how can I tell in a generic way what the type parameters of List<> are?
For example:
class X<T> {
List<String> x1; // String
ArrayList<String> x2; // String
Subclass...
package java.lang.reflect;
A common interface for all entities that declare type variables.
Returns an array of
TypeVariable objects that
represent the type variables declared by the generic
declaration represented by this
GenericDeclaration
object, in declaration order. Returns an array of length 0 if
the underlying generic declaration declares no type variables.
- Returns:
- an array of
TypeVariable objects that represent
the type variables declared by this generic declaration - Throws:
GenericSignatureFormatError if the generic
signature of this generic declaration does not conform to
the format specified in the Java Virtual Machine Specification,
3rd edition