package sh.calaba.org.codehaus.jackson.type;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
/**
* This class is used to pass full generics type information, and
* avoid problems with type erasure (that basically removes most
* usable type references from runtime Class objects).
* It 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. */ public abstract class TypeReference
Comparable
) is to prevent constructing a
* reference without type information.
*/
@Override
public int compareTo(TypeReference