java.lang.Object
com.google.gson.internal.ConstructorConstructor
Returns a function that can construct an instance of a requested type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Type,
InstanceCreator<?>> private final List<ReflectionAccessFilter>
private final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorConstructor
(Map<Type, InstanceCreator<?>> instanceCreators, boolean useJdkUnsafe, List<ReflectionAccessFilter> reflectionFilters) -
Method Summary
Modifier and TypeMethodDescription<T> ObjectConstructor<T>
private static <T> ObjectConstructor<T>
newDefaultConstructor
(Class<? super T> rawType, ReflectionAccessFilter.FilterResult filterResult) private static <T> ObjectConstructor<T>
newDefaultImplementationConstructor
(Type type, Class<? super T> rawType) Constructors for common interface types like Map and List and their subtypes.private static <T> ObjectConstructor<T>
newSpecialCollectionConstructor
(Type type, Class<? super T> rawType) Creates constructors for special JDK collection types which do not have a public no-args constructor.private <T> ObjectConstructor<T>
newUnsafeAllocator
(Class<? super T> rawType) toString()
-
Field Details
-
instanceCreators
-
useJdkUnsafe
private final boolean useJdkUnsafe -
reflectionFilters
-
-
Constructor Details
-
ConstructorConstructor
public ConstructorConstructor(Map<Type, InstanceCreator<?>> instanceCreators, boolean useJdkUnsafe, List<ReflectionAccessFilter> reflectionFilters)
-
-
Method Details
-
get
-
newSpecialCollectionConstructor
private static <T> ObjectConstructor<T> newSpecialCollectionConstructor(Type type, Class<? super T> rawType) Creates constructors for special JDK collection types which do not have a public no-args constructor. -
newDefaultConstructor
private static <T> ObjectConstructor<T> newDefaultConstructor(Class<? super T> rawType, ReflectionAccessFilter.FilterResult filterResult) -
newDefaultImplementationConstructor
private static <T> ObjectConstructor<T> newDefaultImplementationConstructor(Type type, Class<? super T> rawType) Constructors for common interface types like Map and List and their subtypes. -
newUnsafeAllocator
-
toString
-