Class JSickoFallbackInstantiatorStrategy
- java.lang.Object
-
- org.objenesis.strategy.BaseInstantiatorStrategy
-
- ch.usi.si.codelounge.jsicko.plugin.utils.JSickoFallbackInstantiatorStrategy
-
- All Implemented Interfaces:
org.objenesis.strategy.InstantiatorStrategy
public class JSickoFallbackInstantiatorStrategy extends org.objenesis.strategy.BaseInstantiatorStrategyJSicko composed fallback strategy for classes without default empty constructor.The composed fallback strategy supports the following cases:
If the class is Serializable, it will use Kryo's SerializingInstantiatorStrategy, which (quoting Kryo's documentation) uses Java's built-in serialization mechanism to create an instance. Using this, the class must implement java.io.Serializable and the first zero argument constructor in a super class is invoked.
If the class is not Serializable, it will default to StdInstantiatorStrategy, which uses JVM specific APIs to create an instance of a class without calling any constructor at all. This is in general dangerous if there is some logic in the constructors that is expected to be called, but there is no alternative in this case.
-
-
Constructor Summary
Constructors Constructor Description JSickoFallbackInstantiatorStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> org.objenesis.instantiator.ObjectInstantiator<T>newInstantiatorOf(Class<T> type)
-
-
-
Method Detail
-
newInstantiatorOf
public <T> org.objenesis.instantiator.ObjectInstantiator<T> newInstantiatorOf(Class<T> type)
-
-