Package com.google.gson.internal
Class UnsafeAllocator
java.lang.Object
com.google.gson.internal.UnsafeAllocator
Do sneaky things to allocate objects without invoking their constructors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidassertInstantiable(Class<?> c) Check if the class can be instantiated by unsafe allocator.static UnsafeAllocatorcreate()abstract <T> TnewInstance(Class<T> c)
-
Constructor Details
-
UnsafeAllocator
public UnsafeAllocator()
-
-
Method Details
-
newInstance
- Throws:
Exception
-
create
-
assertInstantiable
Check if the class can be instantiated by unsafe allocator. If the instance has interface or abstract modifiers throw anUnsupportedOperationException- Parameters:
c- instance of the class to be checked
-