|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.resteasy.util.GenericType<T>
public class GenericType<T>
This class is a trick used to extract GenericType information at runtime. Java does not allow you get generic type information easily, so this class does the trick. For example:
Type genericType = (new GenericTypeThe above code will get you the genericType for List>() {}).getGenericType();
| Constructor Summary | |
|---|---|
protected |
GenericType()
Constructs a new generic entity. |
| Method Summary | |
|---|---|
java.lang.reflect.Type |
getGenericType()
Gets underlying Type instance. |
java.lang.Class<T> |
getType()
Gets the raw type of the enclosed entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected GenericType()
entity - the entity instance, must not be null
java.lang.IllegalArgumentException - if entity is null| Method Detail |
|---|
public final java.lang.Class<T> getType()
ArrayList not List.
public final java.lang.reflect.Type getGenericType()
Type instance. Note that this is derived from the
type parameter, not the enclosed instance. I.e. in the example
in the introduction, the type is List<String> not
ArrayList<String>.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||