Class ConstructorConstructor
java.lang.Object
com.google.gson.internal.ConstructorConstructor
Returns a function that can construct an instance of a requested type.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorConstructor(Map<Type, InstanceCreator<?>> instanceCreators, boolean useJdkUnsafe, List<ReflectionAccessFilter> reflectionFilters) -
Method Summary
Modifier and TypeMethodDescription<T> ObjectConstructor<T> Callsget(TypeToken, boolean), and allows usage of JDK Unsafe.<T> ObjectConstructor<T> Retrieves an object constructor for the given type.toString()
-
Constructor Details
-
ConstructorConstructor
public ConstructorConstructor(Map<Type, InstanceCreator<?>> instanceCreators, boolean useJdkUnsafe, List<ReflectionAccessFilter> reflectionFilters)
-
-
Method Details
-
get
Callsget(TypeToken, boolean), and allows usage of JDK Unsafe. -
get
Retrieves an object constructor for the given type.- Parameters:
typeToken- type for which a constructor should be retrievedallowUnsafe- whether to allow usage of JDK Unsafe; has no effect ifuseJdkUnsafeis false
-
toString
-