|
31 | 31 | *<pre>
|
32 | 32 | * JavaType stringCollection = mapper.getTypeFactory().constructCollectionType(List.class, String.class);
|
33 | 33 | *</pre>
|
| 34 | + *<p> |
| 35 | + * Note on optimizations: generic type parameters are resolved for all types, with following |
| 36 | + * exceptions: |
| 37 | + *<ul> |
| 38 | + * <li>For optimization purposes, type resolution is skipped for following commonly seen |
| 39 | + * types that do have type parameters, but ones that are rarely needed: |
| 40 | + * <ul> |
| 41 | + * <li>{@link java.lang.Enum}: Self-referential type reference is simply dropped and |
| 42 | + * Class is exposed as a simple, non-parameterized {@link SimpleType} |
| 43 | + * </li> |
| 44 | + * <li>{@link java.lang.Comparable}: Type parameter is simply dropped and and |
| 45 | + * interface is exposed as a simple, non-parameterized {@link SimpleType} |
| 46 | + * </li> |
| 47 | + * <li>Up until Jackson 2.13, {@link java.lang.Class} type parameter was dropped; resolution |
| 48 | + * was added back in Jackson 2.14. |
| 49 | + * </li> |
| 50 | + * </ul> |
| 51 | + * </li> |
| 52 | + * <li>For {@link java.util.Collection} subtypes, resolved type is ALWAYS the parameter for |
| 53 | + * {link java.util.Collection} and not that of actually resolved subtype. |
| 54 | + * This is usually (but not always) same parameter. |
| 55 | + * </li> |
| 56 | + * <li>For {@link java.util.Map} subtypes, resolved type is ALWAYS the parameter for |
| 57 | + * {link java.util.Map} and not that of actually resolved subtype. |
| 58 | + * These are usually (but not always) same parameters. |
| 59 | + * </li> |
| 60 | + *</ul> |
34 | 61 | */
|
35 | 62 | @SuppressWarnings({"rawtypes" })
|
36 | 63 | public class TypeFactory // note: was final in 2.9, removed from 2.10
|
@@ -63,7 +90,6 @@ public class TypeFactory // note: was final in 2.9, removed from 2.10
|
63 | 90 | private final static Class<?> CLS_OBJECT = Object.class;
|
64 | 91 |
|
65 | 92 | private final static Class<?> CLS_COMPARABLE = Comparable.class;
|
66 |
| - private final static Class<?> CLS_CLASS = Class.class; |
67 | 93 | private final static Class<?> CLS_ENUM = Enum.class;
|
68 | 94 | private final static Class<?> CLS_JSON_NODE = JsonNode.class; // since 2.10
|
69 | 95 |
|
|
0 commit comments