1
1
package com .fasterxml .jackson .databind .type ;
2
2
3
- import java .lang .reflect .Array ;
4
- import java .lang .reflect .GenericArrayType ;
5
- import java .lang .reflect .ParameterizedType ;
6
- import java .lang .reflect .Type ;
7
- import java .lang .reflect .TypeVariable ;
8
- import java .lang .reflect .WildcardType ;
3
+ import java .lang .reflect .*;
9
4
import java .util .*;
10
5
import java .util .concurrent .atomic .AtomicReference ;
11
6
import java .util .stream .BaseStream ;
18
13
19
14
import com .fasterxml .jackson .databind .JavaType ;
20
15
import com .fasterxml .jackson .databind .JsonNode ;
21
- import com .fasterxml .jackson .databind .util .ArrayBuilders ;
22
- import com .fasterxml .jackson .databind .util .ClassUtil ;
23
- import com .fasterxml .jackson .databind .util .LRUMap ;
24
- import com .fasterxml .jackson .databind .util .LookupCache ;
16
+ import com .fasterxml .jackson .databind .util .*;
25
17
26
18
/**
27
19
* Class used for creating concrete {@link JavaType} instances,
70
62
* </li>
71
63
*</ul>
72
64
*/
73
- @ SuppressWarnings ({"rawtypes" })
74
65
public class TypeFactory // note: was final in 2.9, removed from 2.10
75
66
implements java .io .Serializable
76
67
{
@@ -79,8 +70,6 @@ public class TypeFactory // note: was final in 2.9, removed from 2.10
79
70
/**
80
71
* Default size used to construct {@link #_typeCache}.
81
72
*
82
- * Used to be passed inline.
83
- *
84
73
* @since 2.16
85
74
*/
86
75
public static final int DEFAULT_MAX_CACHE_SIZE = 200 ;
@@ -222,6 +211,14 @@ protected TypeFactory(LookupCache<Object,JavaType> typeCache, TypeParser p,
222
211
_classLoader = classLoader ;
223
212
}
224
213
214
+ /**
215
+ * Method used to construct a new default/standard {@code TypeFactory}
216
+ * instance; an instance which has no custom configuration.
217
+ *
218
+ * @since 2.19
219
+ */
220
+ public static TypeFactory createDefaultInstance () { return new TypeFactory (); }
221
+
225
222
/**
226
223
* "Mutant factory" method which will construct a new instance with specified
227
224
* {@link TypeModifier} added as the first modifier to call (in case there
@@ -923,6 +920,7 @@ public ArrayType constructArrayType(JavaType elementType) {
923
920
* NOTE: type modifiers are NOT called on Collection type itself; but are called
924
921
* for contained types.
925
922
*/
923
+ @ SuppressWarnings ({"rawtypes" })
926
924
public CollectionType constructCollectionType (Class <? extends Collection > collectionClass ,
927
925
Class <?> elementClass ) {
928
926
return constructCollectionType (collectionClass ,
@@ -935,6 +933,7 @@ public CollectionType constructCollectionType(Class<? extends Collection> collec
935
933
* NOTE: type modifiers are NOT called on Collection type itself; but are called
936
934
* for contained types.
937
935
*/
936
+ @ SuppressWarnings ({"rawtypes" })
938
937
public CollectionType constructCollectionType (Class <? extends Collection > collectionClass ,
939
938
JavaType elementType )
940
939
{
@@ -986,6 +985,7 @@ public CollectionLikeType constructCollectionLikeType(Class<?> collectionClass,
986
985
* NOTE: type modifiers are NOT called on constructed type itself; but are called
987
986
* for contained types.
988
987
*/
988
+ @ SuppressWarnings ({"rawtypes" })
989
989
public MapType constructMapType (Class <? extends Map > mapClass ,
990
990
Class <?> keyClass , Class <?> valueClass ) {
991
991
JavaType kt , vt ;
@@ -1003,6 +1003,7 @@ public MapType constructMapType(Class<? extends Map> mapClass,
1003
1003
*<p>
1004
1004
* NOTE: type modifiers are NOT called on constructed type itself.
1005
1005
*/
1006
+ @ SuppressWarnings ({"rawtypes" })
1006
1007
public MapType constructMapType (Class <? extends Map > mapClass , JavaType keyType , JavaType valueType ) {
1007
1008
TypeBindings bindings = TypeBindings .createIfNeeded (mapClass , new JavaType [] { keyType , valueType });
1008
1009
MapType result = (MapType ) _fromClass (null , mapClass , bindings );
@@ -1232,6 +1233,7 @@ public JavaType constructParametrizedType(Class<?> parametrized, Class<?> parame
1232
1233
*<p>
1233
1234
* This method should only be used if parameterization is completely unavailable.
1234
1235
*/
1236
+ @ SuppressWarnings ({"rawtypes" })
1235
1237
public CollectionType constructRawCollectionType (Class <? extends Collection > collectionClass ) {
1236
1238
return constructCollectionType (collectionClass , unknownType ());
1237
1239
}
@@ -1262,6 +1264,7 @@ public CollectionLikeType constructRawCollectionLikeType(Class<?> collectionClas
1262
1264
*<p>
1263
1265
* This method should only be used if parameterization is completely unavailable.
1264
1266
*/
1267
+ @ SuppressWarnings ({"rawtypes" })
1265
1268
public MapType constructRawMapType (Class <? extends Map > mapClass ) {
1266
1269
return constructMapType (mapClass , unknownType (), unknownType ());
1267
1270
}
0 commit comments