ResolvedType implementation
(implemented by JavaType from "databind" bundle) to be used.
Class is based on ideas from
http://gafter.blogspot.com/2006/12/super-type-tokens.html,
Additional idea (from a suggestion made in comments of the article)
is to require bogus implementation of Comparable
(any such generic interface would do, as long as it forces a method
with generic type to be implemented).
to ensure that a Type argument is indeed given.
Usage is by sub-classing: here is one way to instantiate reference
to generic type List<Integer>:
TypeReference ref = new TypeReference<List<Integer>>() { };
which can be passed to methods that accept TypeReference, or resolved
using TypeFactory to obtain ResolvedType.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(TypeReference<T>
the object to be compared. o)Implements java. The only reason we define this method (and require implementation
of |
| public Type |
| _type | back to summary |
|---|---|
| protected final Type _type | |
| TypeReference | back to summary |
|---|---|
| protected TypeReference() | |
| compareTo | back to summary |
|---|---|
| public int compareTo(TypeReference<T> o) Implements java. The only reason we define this method (and require implementation
of
| |
| getType | back to summary |
|---|---|
| public Type getType() | |