- java.lang.Object
-
- com.google.gson.internal.ConstructorConstructor
-
public final class ConstructorConstructor extends java.lang.Object
Returns a function that can construct an instance of a requested type.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.reflect.Type,InstanceCreator<?>>
instanceCreators
private java.util.List<ReflectionAccessFilter>
reflectionFilters
private boolean
useJdkUnsafe
-
Constructor Summary
Constructors Constructor Description ConstructorConstructor(java.util.Map<java.lang.reflect.Type,InstanceCreator<?>> instanceCreators, boolean useJdkUnsafe, java.util.List<ReflectionAccessFilter> reflectionFilters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ObjectConstructor<T>
get(TypeToken<T> typeToken)
private static <T> ObjectConstructor<T>
newDefaultConstructor(java.lang.Class<? super T> rawType, ReflectionAccessFilter.FilterResult filterResult)
private static <T> ObjectConstructor<T>
newDefaultImplementationConstructor(java.lang.reflect.Type type, java.lang.Class<? super T> rawType)
Constructors for common interface types like Map and List and their subtypes.private static <T> ObjectConstructor<T>
newSpecialCollectionConstructor(java.lang.reflect.Type type, java.lang.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(java.lang.Class<? super T> rawType)
java.lang.String
toString()
-
-
-
Field Detail
-
instanceCreators
private final java.util.Map<java.lang.reflect.Type,InstanceCreator<?>> instanceCreators
-
useJdkUnsafe
private final boolean useJdkUnsafe
-
reflectionFilters
private final java.util.List<ReflectionAccessFilter> reflectionFilters
-
-
Constructor Detail
-
ConstructorConstructor
public ConstructorConstructor(java.util.Map<java.lang.reflect.Type,InstanceCreator<?>> instanceCreators, boolean useJdkUnsafe, java.util.List<ReflectionAccessFilter> reflectionFilters)
-
-
Method Detail
-
get
public <T> ObjectConstructor<T> get(TypeToken<T> typeToken)
-
newSpecialCollectionConstructor
private static <T> ObjectConstructor<T> newSpecialCollectionConstructor(java.lang.reflect.Type type, java.lang.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(java.lang.Class<? super T> rawType, ReflectionAccessFilter.FilterResult filterResult)
-
newDefaultImplementationConstructor
private static <T> ObjectConstructor<T> newDefaultImplementationConstructor(java.lang.reflect.Type type, java.lang.Class<? super T> rawType)
Constructors for common interface types like Map and List and their subtypes.
-
newUnsafeAllocator
private <T> ObjectConstructor<T> newUnsafeAllocator(java.lang.Class<? super T> rawType)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-