### Install and Run Objenesis TCK on Android Source: https://objenesis.org/details.html Install the Objenesis TCK for Android using ADB and then run the instrumentation tests. ```bash adb install -r objenesis-tck-android-3.5.apk ``` ```bash adb shell am instrument -w org.objenesis.tck.android/.TckInstrumentation ``` -------------------------------- ### Specific Instantiator Examples Source: https://objenesis.org/apidocs/index-all.html Examples of concrete instantiator classes available in Objenesis. ```APIDOC ## Specific Instantiator Examples ### Description This section lists various concrete `ObjectInstantiator` implementations provided by Objenesis for different Java versions and scenarios. ### Instantiators * **Android Instantiators**: `Android10Instantiator`, `Android17Instantiator`, `Android18Instantiator`, `AndroidSerializationInstantiator` * **Basic Instantiators**: `ConstructorInstantiator`, `DelegatingToExoticInstantiator`, `FailingInstantiator`, `NewInstanceInstantiator`, `NullInstantiator`, `ObjectInputStreamInstantiator`, `ObjectStreamClassInstantiator` * **GCJ Instantiators**: `GCJInstantiator`, `GCJInstantiatorBase`, `GCJSerializationInstantiator` * **Perc Instantiators**: `PercInstantiator`, `PercSerializationInstantiator` * **Sun Instantiators**: `SunReflectionFactoryInstantiator`, `SunReflectionFactorySerializationInstantiator`, `UnsafeFactoryInstantiator` ### Note Each of these classes typically implements the `newInstance()` method to create an object instance according to its specific strategy. ``` -------------------------------- ### Direct Object Instantiation with Objenesis Source: https://objenesis.org/tutorial.html Instantiate an object directly using the Objenesis instance without explicitly getting an ObjectInstantiator. This is a convenient shortcut. ```java Objenesis objenesis = new ObjenesisStd(); // or ObjenesisSerializer MyThingy thingy1 = (MyThingy) objenesis.newInstance(MyThingy.class); ``` -------------------------------- ### Efficient Object Instantiation with Reusable Instantiator Source: https://objenesis.org/tutorial.html For creating many objects of the same type, it's more efficient to reuse an ObjectInstantiator. This example shows obtaining the instantiator once and then using it multiple times. ```java Objenesis objenesis = new ObjenesisStd(); // or ObjenesisSerializer ObjectInstantiator thingyInstantiator = objenesis.getInstantiatorOf(MyThingy.class); MyThingy thingy2 = (MyThingy)thingyInstantiator.newInstance(); MyThingy thingy3 = (MyThingy)thingyInstantiator.newInstance(); MyThingy thingy4 = (MyThingy)thingyInstantiator.newInstance(); ``` -------------------------------- ### SerializationInstantiatorHelper Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/SerializationInstantiatorHelper.html Default constructor for SerializationInstantiatorHelper. No specific setup is required. ```java public SerializationInstantiatorHelper() ``` -------------------------------- ### ObjectInputStreamInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/ObjectInputStreamInstantiator.html The constructor for ObjectInputStreamInstantiator requires the Class object of the type to be instantiated. This setup is necessary for the instantiator to operate. ```java public ObjectInputStreamInstantiator(Class clazz) ``` -------------------------------- ### Maven Shade Plugin for Objenesis Relocation Source: https://objenesis.org/embedding.html Configure the maven-shade-plugin to relocate Objenesis classes. This setup ensures that Objenesis dependencies are included and their packages are remapped to avoid conflicts. ```xml maven-shade-plugin package shade true org.objenesis:objenesis org.objenesis org.easymock.classextension.internal.objenesis ``` -------------------------------- ### Get ObjectInstantiator for Efficient Instantiation Source: https://objenesis.org/apidocs/org/objenesis/Objenesis.html Obtain an `ObjectInstantiator` for a specific class. If you need to create many instances of the same class, using an `ObjectInstantiator` is significantly more efficient than repeatedly calling `newInstance`. ```java ObjectInstantiator getInstantiatorOf(Class clazz) ``` -------------------------------- ### Search for Working Objenesis Instantiators Source: https://objenesis.org/details.html Use this command to find which Objenesis instantiators work on your platform by iterating through all available options. ```bash java -cp objenesis-3.5-tck.jar org.objenesis.tck.search.SearchWorkingInstantiator ``` -------------------------------- ### NewInstanceInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/package-summary.html The simplest instantiator - simply calls Class.newInstance(). ```APIDOC ## NewInstanceInstantiator ### Description The simplest instantiator - simply calls Class.newInstance(). ### Class Summary Class | Description ---|--- NewInstanceInstantiator | The simplest instantiator - simply calls Class.newInstance(). ``` -------------------------------- ### Get ObjectInstantiator for a Specific Class Source: https://objenesis.org/tutorial.html Obtain an ObjectInstantiator for a specific class type using the Objenesis instance. ```java ObjectInstantiator thingyInstantiator = objenesis.getInstantiatorOf(MyThingy.class); ``` -------------------------------- ### PercSerializationInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/perc/PercSerializationInstantiator.html The constructor for PercSerializationInstantiator requires the Class object of the type to be instantiated. This setup is necessary for the instantiator to operate. ```java public PercSerializationInstantiator(Class type) ``` -------------------------------- ### ObjenesisBase Methods Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisBase.html Methods for creating object instances and retrieving instantiators. ```APIDOC ## newInstance(Class clazz) ### Description Will create a new object without any constructor being called. ### Method public T newInstance(Class clazz) ### Type Parameters * **T** - Type instantiated ### Parameters * **clazz** (Class) - Class to instantiate ### Returns New instance of clazz ## getInstantiatorOf(Class clazz) ### Description Will pick the best instantiator for the provided class. If you need to create a lot of instances from the same class, it is way more efficient to create them from the same ObjectInstantiator than calling `newInstance(Class)`. ### Method public ObjectInstantiator getInstantiatorOf(Class clazz) ### Type Parameters * **T** - Type to instantiate ### Parameters * **clazz** (Class) - Class to instantiate ### Returns Instantiator dedicated to the class ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/AndroidSerializationInstantiator.html Creates and returns a new instance of the object. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object. The class of the returned object is determined by the implementation. ### Signature ```java public T newInstance() ``` ### Returns A new instance of an object. ``` -------------------------------- ### Android10Instantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/Android10Instantiator.html The constructor for Android10Instantiator requires the Class object of the type to be instantiated. This setup is necessary before creating new instances. ```java public Android10Instantiator(Class type) ``` -------------------------------- ### GCJInstantiatorBase Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJInstantiatorBase.html Initializes a new GCJInstantiatorBase with the specified class type. ```APIDOC ## GCJInstantiatorBase(Class type) ### Description Initializes a new GCJInstantiatorBase with the specified class type. ### Constructor `public GCJInstantiatorBase(Class type)` ### Parameters * **type** (Class) - The class for which instances will be created. ``` -------------------------------- ### AndroidSerializationInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/AndroidSerializationInstantiator.html The constructor for AndroidSerializationInstantiator requires the Class object of the type to be instantiated. This setup is necessary before creating new instances. ```java public AndroidSerializationInstantiator(Class type) ``` -------------------------------- ### ConstructorInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/package-summary.html Instantiates a class by grabbing the no args constructor and calling Constructor.newInstance(). ```APIDOC ## ConstructorInstantiator ### Description Instantiates a class by grabbing the no args constructor and calling Constructor.newInstance(). ### Class Summary Class | Description ---|--- ConstructorInstantiator | Instantiates a class by grabbing the no args constructor and calling Constructor.newInstance(). ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/sun/SunReflectionFactorySerializationInstantiator.html Returns a new instance of an object created by this instantiator. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object. The class of the returned object is determined by the implementation. ### Signature ```java public T newInstance() ``` ### Returns A new instance of an object of type T. ``` -------------------------------- ### Get sun.misc.Unsafe Instance Source: https://objenesis.org/apidocs/org/objenesis/instantiator/util/UnsafeUtils.html This static method provides access to the singleton instance of sun.misc.Unsafe. Use with caution as it bypasses standard Java safety mechanisms. ```java public static sun.misc.Unsafe getUnsafe() ``` -------------------------------- ### ConstructorInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/ConstructorInstantiator.html Instantiates a class by grabbing the no-args constructor and calling Constructor.newInstance(). This can deal with default public constructors, but that's about it. ```APIDOC ## Class ConstructorInstantiator Instantiates a class by grabbing the no-args constructor and calling Constructor.newInstance(). This can deal with default public constructors, but that's about it. ### Constructor * **ConstructorInstantiator**(Class type) * Creates a new instance of ConstructorInstantiator for the given class type. ### Method * **newInstance**(): T * Returns a new instance of an object. The returned object's class is defined by the implementation. * Specified by: `newInstance` in interface `ObjectInstantiator` * Returns: A new instance of an object. ``` -------------------------------- ### ObjenesisBase Constructors using InstantiatorStrategy Source: https://objenesis.org/apidocs/org/objenesis/strategy/class-use/InstantiatorStrategy.html Demonstrates the constructors of ObjenesisBase that accept an InstantiatorStrategy to define object instantiation behavior. ```APIDOC ## ObjenesisBase(InstantiatorStrategy strategy) ### Description Constructor allowing to pick a strategy and using cache. ### Parameters #### Path Parameters - **strategy** (InstantiatorStrategy) - Required - The instantiation strategy to use. ``` ```APIDOC ## ObjenesisBase(InstantiatorStrategy strategy, boolean useCache) ### Description Flexible constructor allowing to pick the strategy and if caching should be used. ### Parameters #### Path Parameters - **strategy** (InstantiatorStrategy) - Required - The instantiation strategy to use. - **useCache** (boolean) - Required - Whether to use caching for instantiators. ``` -------------------------------- ### Get Non-Serializable Superclass Source: https://objenesis.org/apidocs/org/objenesis/instantiator/SerializationInstantiatorHelper.html Retrieves the first non-serializable superclass of a given class. This is crucial for correct object initialization during deserialization, as per Java Object Serialization Specification. ```java public static Class getNonSerializableSuperClass(Class type) ``` -------------------------------- ### newInstance Source: https://objenesis.org/apidocs/org/objenesis/instantiator/util/ClassUtils.html Creates a new instance of the given class. ```APIDOC ## newInstance ### Description Creates a new instance of the given class. ### Method `public static T newInstance(Class clazz)` ### Parameters #### Path Parameters - **clazz** (Class) - Required - The class to instantiate ``` -------------------------------- ### Basic Instantiators Source: https://objenesis.org/apidocs/org/objenesis/instantiator/annotations/class-use/Instantiator.html Core Objenesis instantiators providing various strategies for object creation, including reflection and stream-based methods. ```APIDOC ## AccessibleInstantiator ### Description Instantiates a class by grabbing the no-args constructor, making it accessible and then calling `Constructor.newInstance()`. ## ConstructorInstantiator ### Description Instantiates a class by grabbing the no args constructor and calling `Constructor.newInstance()`. ## FailingInstantiator ### Description The instantiator that always throws an exception. ## NewInstanceInstantiator ### Description The simplest instantiator - simply calls `Class.newInstance()`. ## NullInstantiator ### Description The instantiator that always returns a null instance. ## ObjectInputStreamInstantiator ### Description Instantiates a class by using a dummy input stream that always feeds data for an empty object of the same kind. ## ObjectStreamClassInstantiator ### Description Instantiates a class by using reflection to make a call to private method `ObjectStreamClass.newInstance`, present in many JVM implementations. ## ProxyingInstantiator ### Description Shell keeping compatibility but delegating to objenesis-exotic which contains the real implementation. ``` -------------------------------- ### Use Custom Objenesis Strategy Source: https://objenesis.org/details.html Instantiate Objenesis with your custom strategy directly or by extending ObjenesisBase. ```java Objenesis o = new ObjenesisBase(new Sun14Strategy()); ``` ```java public class ObjenesisSun14 extends ObjenesisBase { public ObjenesisSun14() { super(new Sun14Strategy()); } } ``` -------------------------------- ### GCJInstantiatorBase Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJInstantiatorBase.html Initializes the GCJInstantiatorBase with the class type it will instantiate. ```java public GCJInstantiatorBase(Class type) ``` -------------------------------- ### Get Serializable Object Instantiator Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisHelper.html Obtains an ObjectInstantiator that emulates the behavior of ObjectInputStream.readObject. This is useful when you need to create multiple serializable objects with behavior consistent with Java's deserialization process. ```java public static ObjectInstantiator getSerializableObjectInstantiatorOf(Class clazz) ``` -------------------------------- ### Get Object Instantiator Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisHelper.html Retrieves an ObjectInstantiator for a given class. For scenarios requiring frequent instantiation of objects from the same class, using an ObjectInstantiator is significantly more efficient than repeatedly calling newInstance(Class). ```java public static ObjectInstantiator getInstantiatorOf(Class clazz) ``` -------------------------------- ### Run Objenesis TCK from Command Line Source: https://objenesis.org/details.html Execute the Objenesis Test Compatibility Kit (TCK) from the command line. The Objenesis jar is bundled within the TCK, so no special classpath configuration is needed. ```bash java -jar objenesis-3.5-tck.jar ``` -------------------------------- ### Describe Platform Method - Objenesis Source: https://objenesis.org/apidocs/org/objenesis/strategy/PlatformDescription.html This static method returns a string describing the current platform, including the Java version and vendor. It's useful for logging or debugging. ```java public static String describePlatform() ``` -------------------------------- ### ObjenesisHelper Static Methods Source: https://objenesis.org/apidocs/index-all.html ObjenesisHelper provides utility methods for creating instances, including a method for serializable instances. ```APIDOC ## ObjenesisHelper Static Methods ### Description Utility methods for object instantiation. ### Method Signatures 1. `newInstance(Class)` 2. `newSerializableInstance(Class)` ### Parameters * **Class** - The class for which to create a new instance. ### Response * **T** - A new instance of the specified class. ### Notes `newSerializableInstance` creates an object similar to `ObjectInputStream.readObject`, calling the default constructor of the first non-serializable class. ``` -------------------------------- ### Instantiate Objenesis Object Source: https://objenesis.org/tutorial.html Create an instance of ObjenesisStd for standard instantiation or ObjenesisSerializer for serializable-compliant instantiation. Objenesis automatically determines the best strategy by default. ```java Objenesis objenesis = new ObjenesisStd(); // or ObjenesisSerializer ``` -------------------------------- ### GCJInstantiatorBase newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJInstantiatorBase.html Abstract method to create a new instance of the object. This must be implemented by subclasses. ```java public abstract T newInstance() ``` -------------------------------- ### Instantiate Object Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/AccessibleInstantiator.html The `newInstance()` method, inherited from `ConstructorInstantiator`, is used to create a new instance of the class. This method will utilize the accessible no-argument constructor. ```APIDOC ## newInstance Method ### Description Creates a new instance of the class using the accessible no-argument constructor. ### Method Signature `T newInstance()` ### Returns * A new instance of type `T`. ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/NewInstanceInstantiator.html Creates and returns a new instance of the object using the Class.newInstance() method. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object. This method utilizes the `Class.newInstance()` internally, which requires a default public constructor. ### Method `T newInstance()` ### Returns * **T** - A new instance of the object. ``` -------------------------------- ### PlatformDescription Source: https://objenesis.org/apidocs/index-all.html Provides information about the current platform. ```APIDOC ## PlatformDescription ### Description Provides information about the current platform. ### Static Variables - `ANDROID_VERSION`: Android version. - `DALVIK`: JVM_NAME prefix for Dalvik/Android. ### Static Methods #### `describePlatform()` Describes the platform. ``` -------------------------------- ### InstantiatorStrategy Implementations Source: https://objenesis.org/apidocs/index-all.html Provides different strategies for creating object instantiators, including standard, serializing, and single instantiator strategies. ```APIDOC ## InstantiatorStrategy Implementations ### Description Concrete implementations of `InstantiatorStrategy` offering various ways to create `ObjectInstantiator`s. ### Implementations 1. **SerializingInstantiatorStrategy**: Returns an `ObjectInstantiator` that follows Java serialization specifications. 2. **SingleInstantiatorStrategy**: Returns a single type of `ObjectInstantiator`. 3. **StdInstantiatorStrategy**: Returns an `ObjectInstantiator` that creates instances without calling constructors. ``` -------------------------------- ### Android17Instantiator.newInstance() Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/Android17Instantiator.html Creates a new instance of the object using the Android 17 specific instantiation mechanism. ```APIDOC ## newInstance() ### Description Returns a new instance of an object. This method utilizes internal Android mechanisms to create an object without invoking its constructor, suitable for API levels 11-17. ### Signature ```java public T newInstance() ``` ### Returns * **T** - A new instance of the object. ``` -------------------------------- ### ProxyingInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/package-summary.html Shell keeping compatibility but delegating to objenesis-exotic which contains the real implementation. ```APIDOC ## ProxyingInstantiator ### Description Shell keeping compatibility but delegating to objenesis-exotic which contains the real implementation. ### Class Summary Class | Description ---|--- ProxyingInstantiator | Shell keeping compatibility but delegating to objenesis-exotic which contains the real implementation. ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/DelegatingToExoticInstantiator.html Creates and returns a new instance of the object. This method is implemented based on the ObjectInstantiator interface. ```APIDOC ## Method ### `public T newInstance()` **Description**: Returns a new instance of an object. The specific class of the returned object is determined by the implementation. **Implements**: `newInstance` in interface `ObjectInstantiator` **Returns**: A new instance of an object of type `T`. ``` -------------------------------- ### PlatformDescription Class Source: https://objenesis.org/apidocs/org/objenesis/strategy/package-summary.html Provides constants describing the currently used platform, which might influence instantiation strategies. ```APIDOC ## Class: PlatformDescription ### Description List of constants describing the currently used platform. ``` -------------------------------- ### Platform Description Methods Source: https://objenesis.org/apidocs/org/objenesis/strategy/PlatformDescription.html Methods to describe and query the current Java platform. ```APIDOC ## Methods ### `describePlatform()` `public static String describePlatform()` Describes the platform. Outputs Java version and vendor. Returns: Description of the current platform ### `isAfterJava11()` `public static boolean isAfterJava11()` Tells if the current JVM is running Java 11 or above. ### `isAfterJigsaw()` `public static boolean isAfterJigsaw()` Tells if the current JVM is running Java 9 or above. ### `isAndroidOpenJDK()` `public static boolean isAndroidOpenJDK()` Check if this JVM is an Android JVM based on OpenJDK. ### `isGoogleAppEngine()` `@Deprecated public static boolean isGoogleAppEngine()` Deprecated. No need to differentiate GAE anymore since they have stopped using a security manager. ### `isThisJVM(String name)` `public static boolean isThisJVM(String name)` Check if the current JVM is of the type passed in parameter. Normally, this will be a constant from this class. We basically do `System.getProperty("java.vm.name").startWith(name)`. Parameters: `name` - jvm name we are looking for Returns: if it's the requested JVM ``` -------------------------------- ### Objenesis Interface Methods Source: https://objenesis.org/apidocs/org/objenesis/Objenesis.html This section details the methods available in the Objenesis interface for object instantiation. ```APIDOC ## `newInstance(Class clazz)` ### Description Will create a new object without any constructor being called. ### Method `newInstance` ### Parameters #### Path Parameters - `clazz` (Class) - Description: Class to instantiate ### Returns - `T` - New instance of clazz ## `getInstantiatorOf(Class clazz)` ### Description Will pick the best instantiator for the provided class. If you need to create a lot of instances from the same class, it is way more efficient to create them from the same ObjectInstantiator than calling `newInstance(Class)`. ### Method `getInstantiatorOf` ### Parameters #### Path Parameters - `clazz` (Class) - Description: Class to instantiate ### Returns - `ObjectInstantiator` - Instantiator dedicated to the class ``` -------------------------------- ### DelegatingToExoticInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/class-use/ObjectInstantiator.html Helper class for instantiators whose implementation is moved to the exotic project. ```APIDOC ## DelegatingToExoticInstantiator ### Description Helper class extended by instantiators for which the implementation was moved to the exotic project. ### Implements `ObjectInstantiator` ``` -------------------------------- ### Use ObjenesisHelper for Static Access Source: https://objenesis.org/details.html ObjenesisHelper provides static methods for creating new instances and retrieving instantiators. Use this if you need static access, but be aware of the potential drawbacks of static methods. ```java Object o1 = ObjenesisHelper.newInstance(MyClass.class); Object o2 = ObjenesisHelper.newSerializableInstance(MyClass.class); ObjectInstantiator o3 = ObjenesisHelper.getInstantiatorOf(MyClass.class); ObjectInstantiator o4 = ObjenesisHelper.getSerializableObjectInstantiatorOf(MyClass.class); ``` -------------------------------- ### AccessibleInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/package-summary.html Instantiates a class by grabbing the no-args constructor, making it accessible, and then calling Constructor.newInstance(). ```APIDOC ## AccessibleInstantiator ### Description Instantiates a class by grabbing the no-args constructor, making it accessible and then calling Constructor.newInstance(). ### Class Summary Class | Description ---|--- AccessibleInstantiator | Instantiates a class by grabbing the no-args constructor, making it accessible and then calling Constructor.newInstance(). ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/ObjectInputStreamInstantiator.html Creates and returns a new instance of the object using ObjectInputStream. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object by utilizing ObjectInputStream. This method is part of the ObjectInstantiator interface. ### Signature ```java public T newInstance() ``` ### Returns * **T** - A new instance of the object. ``` -------------------------------- ### DelegatingToExoticInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/DelegatingToExoticInstantiator.html Protected constructor for DelegatingToExoticInstantiator. It initializes the instantiator with a class name and its corresponding Class object. ```APIDOC ## Constructor ### `protected DelegatingToExoticInstantiator(String className, Class type)` **Description**: Initializes a new instance of the `DelegatingToExoticInstantiator` class. **Parameters**: - `className` (String): The name of the class to be instantiated. - `type` (Class): The `Class` object representing the type of object to be instantiated. ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJSerializationInstantiator.html Returns a new instance of an object of type T. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object. The returned object's class is defined by the implementation. ### Method ```java public T newInstance() ``` ### Returns * **T** - A new instance of an object. ``` -------------------------------- ### ObjenesisBase Constructor with Strategy Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisBase.html Use this constructor to specify an InstantiatorStrategy and enable caching for ObjectInstantiators. ```java public ObjenesisBase(InstantiatorStrategy strategy) ``` -------------------------------- ### GCJInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJInstantiator.html Initializes a new GCJInstantiator for a given class type. ```APIDOC ## GCJInstantiator Constructor ### Description Initializes a new instance of the `GCJInstantiator` class for the specified class. ### Constructor `public GCJInstantiator(Class type)` ### Parameters * **type** (Class) - The class for which to create instances. ``` -------------------------------- ### ObjectInputStreamInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/package-summary.html Instantiates a class by using a dummy input stream that always feeds data for an empty object of the same kind. ```APIDOC ## ObjectInputStreamInstantiator ### Description Instantiates a class by using a dummy input stream that always feeds data for an empty object of the same kind. ### Class Summary Class | Description ---|--- ObjectInputStreamInstantiator | Instantiates a class by using a dummy input stream that always feeds data for an empty object of the same kind. ``` -------------------------------- ### GCJInstantiator.newInstance() Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJInstantiator.html Creates a new instance of the object using GCJ's internal mechanisms. ```APIDOC ## newInstance() ### Description Returns a new instance of an object. This method utilizes internal GCJ private methods to achieve instantiation without invoking any constructors. This is specifically designed for GCJ JVMs. ### Method `public T newInstance()` ### Returns A new instance of the object of type `T`. ``` -------------------------------- ### GCJInstantiatorBase Source: https://objenesis.org/apidocs/org/objenesis/instantiator/class-use/ObjectInstantiator.html Base class for GCJ-based instantiators. ```APIDOC ## GCJInstantiatorBase ### Description Base class for GCJ-based instantiators. ### Implements `ObjectInstantiator` ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/NullInstantiator.html Returns a new instance of an object. For NullInstantiator, this method always returns null. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object. As per the NullInstantiator's design, this method will always return null. ### Method Signature `T newInstance()` ### Returns * **T** - Always returns null. ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/FailingInstantiator.html Attempts to create a new instance of an object. This method is implemented to always throw an exception, as per the design of FailingInstantiator. ```APIDOC ## newInstance Method ### Description Returns a new instance of an object. This implementation always throws an exception. ### Signature `T newInstance()` ### Returns Always throwing an exception. ``` -------------------------------- ### NewInstanceInstantiator newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/NewInstanceInstantiator.html Creates and returns a new instance of the object using the default public constructor. ```java public T newInstance() ``` -------------------------------- ### SerializingInstantiatorStrategy Constructor Source: https://objenesis.org/apidocs/org/objenesis/strategy/SerializingInstantiatorStrategy.html Initializes a new instance of the SerializingInstantiatorStrategy class. This strategy aims to guess the best serializing instantiator for a given class. ```APIDOC ## SerializingInstantiatorStrategy() ### Description Initializes a new instance of the `SerializingInstantiatorStrategy` class. ### Constructor `SerializingInstantiatorStrategy()` ``` -------------------------------- ### ObjenesisBase Constructors Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisBase.html Constructors for ObjenesisBase allow specifying an InstantiatorStrategy and controlling cache usage. ```APIDOC ## ObjenesisBase(InstantiatorStrategy strategy) ### Description Constructor allowing to pick a strategy and using cache. ### Parameters * **strategy** (InstantiatorStrategy) - Strategy to use ## ObjenesisBase(InstantiatorStrategy strategy, boolean useCache) ### Description Flexible constructor allowing to pick the strategy and if caching should be used. ### Parameters * **strategy** (InstantiatorStrategy) - Strategy to use * **useCache** (boolean) - If ObjectInstantiator's should be cached ``` -------------------------------- ### ObjenesisStd Constructors Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisStd.html Details on the constructors available for the ObjenesisStd class. ```APIDOC ## ObjenesisStd() ### Description Default constructor using the `StdInstantiatorStrategy`. ### Constructor `public ObjenesisStd()` ``` ```APIDOC ## ObjenesisStd(boolean useCache) ### Description Instance using the `StdInstantiatorStrategy` with or without caching `ObjectInstantiator`s. ### Parameters - **useCache** (boolean) - If `ObjectInstantiator`s should be cached. ### Constructor `public ObjenesisStd(boolean useCache)` ``` -------------------------------- ### StdInstantiatorStrategy Source: https://objenesis.org/apidocs/index-all.html Strategy for guessing the best general-purpose instantiator for a given class. ```APIDOC ## Class: org.objenesis.strategy.StdInstantiatorStrategy ### Description Guess the best instantiator for a given class. ``` -------------------------------- ### GCJInstantiatorBase Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/package-summary.html Base class for GCJ-based instantiators. ```APIDOC ## Class GCJInstantiatorBase ### Description Base class for GCJ-based instantiators. ### Class Summary - **GCJInstantiatorBase** (Class) ``` -------------------------------- ### SingleInstantiatorStrategy Constructor Source: https://objenesis.org/apidocs/org/objenesis/strategy/SingleInstantiatorStrategy.html Creates a strategy that will always return the same instantiator type. Assumes the provided instantiator has a constructor that takes the class to instantiate as a parameter. ```java public SingleInstantiatorStrategy(Class instantiator) ``` -------------------------------- ### ObjenesisBase Constructor with Strategy and Cache Control Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisBase.html This flexible constructor allows you to select the InstantiatorStrategy and explicitly control whether ObjectInstantiators should be cached. ```java public ObjenesisBase(InstantiatorStrategy strategy, boolean useCache) ``` -------------------------------- ### Implementations of InstantiatorStrategy Source: https://objenesis.org/apidocs/org/objenesis/strategy/class-use/InstantiatorStrategy.html Lists the classes within the org.objenesis.strategy package that implement the InstantiatorStrategy interface. ```APIDOC ## BaseInstantiatorStrategy ### Description Base `InstantiatorStrategy` class. ### Type `class` ``` ```APIDOC ## SerializingInstantiatorStrategy ### Description Guess the best serializing instantiator for a given class. ### Type `class` ``` ```APIDOC ## SingleInstantiatorStrategy ### Description Strategy returning only one instantiator type. ### Type `class` ``` ```APIDOC ## StdInstantiatorStrategy ### Description Guess the best instantiator for a given class. ### Type `class` ``` -------------------------------- ### SingleInstantiatorStrategy Constructor Source: https://objenesis.org/apidocs/org/objenesis/strategy/SingleInstantiatorStrategy.html Creates a new SingleInstantiatorStrategy. This strategy will always return the same type of instantiator, which is assumed to have a constructor that takes the class to be instantiated as a parameter. ```APIDOC ## SingleInstantiatorStrategy Constructor ### Description Create a strategy that will return always the same instantiator type. We assume this instantiator has one constructor taking the class to instantiate in parameter. ### Signature ```java public SingleInstantiatorStrategy(Class instantiator) ``` ### Type Parameters * `T` - the type we want to instantiate ### Parameters * **instantiator** (Class) - the instantiator type ``` -------------------------------- ### Android18Instantiator.newInstance() Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/Android18Instantiator.html Creates and returns a new instance of the object for the class specified during instantiation. ```APIDOC ## newInstance() ### Description Returns a new instance of an object. The returned object's class is defined by the implementation. ### Signature `public T newInstance()` ### Returns * **T** - A new instance of an object. ``` -------------------------------- ### Implement Custom Objenesis Strategy Source: https://objenesis.org/details.html Implement your own Objenesis strategy by extending InstantiatorStrategy. This is useful for JVM-specific optimizations or when Objenesis doesn't support your environment by default. ```java public class Sun14Strategy implements InstantiatorStrategy { public ObjectInstantiator newInstantiatorOf(Class type) { // return sun dedicated instantiator return new SunReflectionFactoryInstantiator(type); } } ``` -------------------------------- ### BaseInstantiatorStrategy Source: https://objenesis.org/apidocs/index-all.html Base InstantiatorStrategy class. ```APIDOC ## BaseInstantiatorStrategy ### Description Base `InstantiatorStrategy` class basically. ### Constructor `BaseInstantiatorStrategy()` ``` -------------------------------- ### StdInstantiatorStrategy Constructor Source: https://objenesis.org/apidocs/org/objenesis/strategy/StdInstantiatorStrategy.html Initializes a new instance of the StdInstantiatorStrategy class. ```APIDOC ## StdInstantiatorStrategy() ### Description Initializes a new instance of the StdInstantiatorStrategy class. ### Constructor `public StdInstantiatorStrategy()` ``` -------------------------------- ### DelegatingToExoticInstantiator newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/DelegatingToExoticInstantiator.html This method, implemented from the ObjectInstantiator interface, is responsible for returning a new instance of an object. The specific class of the returned object is determined by the implementation. ```java public T newInstance() ``` -------------------------------- ### ProxyingInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/ProxyingInstantiator.html This constructor initializes a new instance of the ProxyingInstantiator class, preparing it to create objects of the specified type. ```APIDOC ## Constructor ### ProxyingInstantiator ```java public ProxyingInstantiator(Class type) ``` #### Description Initializes a new instance of the `ProxyingInstantiator` class. #### Parameters * **type** (Class) - The class for which instances will be created. ``` -------------------------------- ### Instantiate Objects using ObjectInstantiator Source: https://objenesis.org/tutorial.html Use the obtained ObjectInstantiator to create new instances of the specified class. This is efficient for creating multiple objects of the same type. ```java MyThingy thingy1 = (MyThingy)thingyInstantiator.newInstance(); MyThingy thingy2 = (MyThingy)thingyInstantiator.newInstance(); MyThingy thingy3 = (MyThingy)thingyInstantiator.newInstance(); ``` -------------------------------- ### ObjectInputStreamInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/ObjectInputStreamInstantiator.html Initializes a new instance of the ObjectInputStreamInstantiator class for a given class. ```APIDOC ## ObjectInputStreamInstantiator Constructor ### Description Initializes a new instance of the ObjectInputStreamInstantiator class. ### Signature ```java public ObjectInputStreamInstantiator(Class clazz) ``` ### Parameters * **clazz** (Class) - The class for which to create an instantiator. ``` -------------------------------- ### Android17Instantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/Android17Instantiator.html Initializes a new Android17Instantiator for a given class type. ```APIDOC ## Android17Instantiator Constructor ### Description Initializes a new instance of the `Android17Instantiator` class for the specified class type. ### Signature ```java public Android17Instantiator(Class type) ``` ### Parameters * **type** (Class) - The class for which to create instances. ``` -------------------------------- ### MagicInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/sun/MagicInstantiator.html This constructor initializes a new instance of the MagicInstantiator class, preparing it to create objects of the specified type. ```APIDOC ## MagicInstantiator Constructor ### Description Initializes a new instance of the `MagicInstantiator` class. ### Signature `MagicInstantiator(Class type)` ### Parameters * **type** (Class) - The class for which to create an instantiator. ``` -------------------------------- ### Class Hierarchy Source: https://objenesis.org/apidocs/org/objenesis/instantiator/package-tree.html Shows the inheritance structure for classes within the Objenesis instantiator package. ```APIDOC ## Class Hierarchy * java.lang.Object * org.objenesis.instantiator.SerializationInstantiatorHelper ``` -------------------------------- ### StdInstantiatorStrategy Constructor Source: https://objenesis.org/apidocs/org/objenesis/strategy/StdInstantiatorStrategy.html Initializes a new instance of the StdInstantiatorStrategy class. This strategy is used to guess the best instantiator for a given class. ```java public StdInstantiatorStrategy() ``` -------------------------------- ### NewInstanceInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/NewInstanceInstantiator.html Initializes a new instance of the NewInstanceInstantiator for a given class type. ```APIDOC ## NewInstanceInstantiator Constructor ### Description Initializes a new instance of the NewInstanceInstantiator for a given class type. ### Constructor `NewInstanceInstantiator(Class type)` ### Parameters * **type** (Class) - The class for which to create instances. ``` -------------------------------- ### DelegatingToExoticInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/basic/package-summary.html Helper class extended by instantiators for which the implementation was moved to the exotic project. ```APIDOC ## DelegatingToExoticInstantiator ### Description Helper class extended by instantiators for which the implementation was moved to the exotic project. ### Class Summary Class | Description ---|--- DelegatingToExoticInstantiator | Helper class extended by instantiators for which the implementation was moved to the exotic project. ``` -------------------------------- ### newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/instantiator/gcj/GCJInstantiatorBase.html Returns a new instance of an object of type T. This is an abstract method that must be implemented by subclasses. ```APIDOC ## newInstance() ### Description Returns a new instance of an object. The returned object's class is defined by the implementation. ### Method `public abstract T newInstance()` ### Returns * **T** - A new instance of an object. ``` -------------------------------- ### Sun JVM Instantiators Source: https://objenesis.org/apidocs/org/objenesis/instantiator/annotations/class-use/Instantiator.html Instantiators for Sun's JVM, leveraging internal classes like `sun.reflect.ReflectionFactory` and `sun.misc.Unsafe`. ```APIDOC ## MagicInstantiator ### Description Shell keeping compatibility but delegating to objenesis-exotic which contains the real implementation. ## SunReflectionFactoryInstantiator ### Description Instantiates an object, WITHOUT calling its constructor, using internal `sun.reflect.ReflectionFactory` - a class only available on JDK's that use Sun's 1.4 (or later) Java implementation. ## SunReflectionFactorySerializationInstantiator ### Description Instantiates an object using internal `sun.reflect.ReflectionFactory` - a class only available on JDK's that use Sun's 1.4 (or later) Java implementation. ## UnsafeFactoryInstantiator ### Description Instantiates an object, WITHOUT calling its constructor, using `sun.misc.Unsafe.allocateInstance()`. ``` -------------------------------- ### Add Module for Java Platform Module System (InaccessibleObjectException) Source: https://objenesis.org/details.html If you encounter an `InaccessibleObjectException` related to module access, use this flag to open the specified package to the `org.objenesis` module. ```bash --add-opens yyy/zzz=org.objenesis ``` -------------------------------- ### newInstance Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisHelper.html Creates a new instance of a given class without calling any constructors. This is useful for scenarios where constructor logic should be bypassed. ```APIDOC ## newInstance ### Description Will create a new object without any constructor being called. ### Method Signature `public static T newInstance(Class clazz)` ### Parameters * `clazz` (Class) - The class to instantiate. ### Returns * `T` - A new instance of the provided class. ``` -------------------------------- ### ObjenesisBase newInstance Method Source: https://objenesis.org/apidocs/org/objenesis/ObjenesisBase.html Creates a new instance of the specified class without calling any of its constructors. This is the primary method for object instantiation. ```java public T newInstance(Class clazz) ``` -------------------------------- ### ClassUtils Source: https://objenesis.org/apidocs/org/objenesis/instantiator/util/package-summary.html Helper class for playing with classes. ```APIDOC ## ClassUtils ### Description Helper class for to play with classes. ### Class Summary Class | Description ---|--- ClassUtils | Helper class for to play with classes. ``` -------------------------------- ### Sun Instantiator Class Hierarchy Source: https://objenesis.org/apidocs/org/objenesis/instantiator/sun/package-tree.html This snippet shows the inheritance structure of instantiators within the org.objenesis.instantiator.sun package, illustrating how they extend base classes and implement the ObjectInstantiator interface. ```APIDOC ## Class Hierarchy * java.lang.Object * org.objenesis.instantiator.basic.DelegatingToExoticInstantiator (implements org.objenesis.instantiator.ObjectInstantiator) * org.objenesis.instantiator.sun.MagicInstantiator * org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator (implements org.objenesis.instantiator.ObjectInstantiator) * org.objenesis.instantiator.sun.SunReflectionFactorySerializationInstantiator (implements org.objenesis.instantiator.ObjectInstantiator) * org.objenesis.instantiator.sun.UnsafeFactoryInstantiator (implements org.objenesis.instantiator.ObjectInstantiator) ``` -------------------------------- ### Perception (Perc) Instantiators Source: https://objenesis.org/apidocs/org/objenesis/instantiator/annotations/class-use/Instantiator.html Instantiators for the Perception JVM, using its specific internal methods. ```APIDOC ## PercInstantiator ### Description Instantiates a class by making a call to internal Perc private methods. ## PercSerializationInstantiator ### Description Instantiates a class by making a call to internal Perc private methods. ``` -------------------------------- ### ObjectStreamClassInstantiator Source: https://objenesis.org/apidocs/org/objenesis/instantiator/class-use/ObjectInstantiator.html Instantiates a class by using reflection to call the private ObjectStreamClass.newInstance method. ```APIDOC ## ObjectStreamClassInstantiator ### Description Instantiates a class by using reflection to make a call to private method ObjectStreamClass.newInstance, present in many JVM implementations. ### Implements `ObjectInstantiator` ``` -------------------------------- ### Add Module for Java Platform Module System (NoClassDefFoundError) Source: https://objenesis.org/details.html If you encounter a `java.lang.NoClassDefFoundError: sun/misc/Unsafe` due to the Java Platform Module System, add this flag to your JVM arguments. ```bash --add-modules jdk.unsupported ``` -------------------------------- ### Platform Constants Source: https://objenesis.org/apidocs/org/objenesis/strategy/PlatformDescription.html Constants describing the JVM name, vendor, version, and specific platform details. ```APIDOC ## Constants ### `ANDROID_VERSION` `public static final int ANDROID_VERSION` Android version. Will be 0 for none android platform. ### `DALVIK` `public static final String DALVIK` JVM_NAME prefix for Dalvik/Android. ### `GAE_VERSION` `@Deprecated public static final String GAE_VERSION` Deprecated. No need to differentiate GAE anymore since they have stopped using a security manager. Google App Engine version or null is we are not on GAE. ### `GNU` `public static final String GNU` JVM_NAME prefix for GCJ. ### `HOTSPOT` `public static final String HOTSPOT` JVM_NAME prefix for Java HotSpot. ### `IS_ANDROID_OPENJDK` `public static final boolean IS_ANDROID_OPENJDK` Flag telling if this version of Android is based on the OpenJDK. ### `JVM_NAME` `public static final String JVM_NAME` JVM name. ### `OPENJDK` `public static final String OPENJDK` JVM_NAME prefix for the OpenJDK. ### `PERC` `public static final String PERC` JVM_NAME prefix for Aonix PERC. ### `SPECIFICATION_VERSION` `public static final String SPECIFICATION_VERSION` Java specification version. ### `SUN` `@Deprecated public static final String SUN` Deprecated. Use `HOTSPOT` instead. JVM_NAME prefix for Java HotSpot. ### `VENDOR` `public static final String VENDOR` VM vendor name. ### `VENDOR_VERSION` `public static final String VENDOR_VERSION` VM vendor version. ### `VM_INFO` `public static final String VM_INFO` JVM version. ### `VM_VERSION` `public static final String VM_VERSION` JVM version. ``` -------------------------------- ### PlatformDescription.isGoogleAppEngine Source: https://objenesis.org/apidocs/index-all.html Deprecated: Checks if the current environment is Google App Engine. This check is no longer necessary. ```APIDOC ## PlatformDescription.isGoogleAppEngine ### Description Deprecated. No need to differentiate GAE anymore since they have stopped using a security manager. ### Method ```java public static boolean isGoogleAppEngine() ``` ``` -------------------------------- ### SunReflectionFactoryInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/sun/SunReflectionFactoryInstantiator.html This is the constructor for the SunReflectionFactoryInstantiator. It takes the class type as an argument to prepare for instantiation. ```java public SunReflectionFactoryInstantiator(Class type) ``` -------------------------------- ### SerializingInstantiatorStrategy Source: https://objenesis.org/apidocs/index-all.html Strategy for guessing the best serializing instantiator for a given class. ```APIDOC ## Class: org.objenesis.strategy.SerializingInstantiatorStrategy ### Description Guess the best serializing instantiator for a given class. ``` -------------------------------- ### Android10Instantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/android/Android10Instantiator.html Initializes a new instance of the Android10Instantiator class for a given type. ```APIDOC ## Android10Instantiator Constructor ### Description Initializes a new instance of the Android10Instantiator class for a given type. ### Method Signature `public Android10Instantiator(Class type)` ### Parameters * **type** (Class) - The class for which to create an instantiator. ``` -------------------------------- ### ClassUtils Static Method Source: https://objenesis.org/apidocs/index-all.html Utility method for creating new instances of a class. ```APIDOC ## ClassUtils Static Method ### Description A utility method to create a new instance of a given class. ### Method Signature `newInstance(Class)` ### Parameters * **Class** - The class for which to create a new instance. ### Response * **T** - A new instance of the specified class. ``` -------------------------------- ### SerializationInstantiatorHelper Class Source: https://objenesis.org/apidocs/org/objenesis/instantiator/package-summary.html A helper class providing common functions for serialization-compatible object instantiation. ```APIDOC ## Class: SerializationInstantiatorHelper ### Description Helper for common serialization-compatible instantiation functions. This class likely provides static methods to facilitate the creation of objects in a way that is compatible with Java serialization mechanisms. ``` -------------------------------- ### SerializingInstantiatorStrategy Constructor Source: https://objenesis.org/apidocs/org/objenesis/strategy/SerializingInstantiatorStrategy.html This is the default constructor for the SerializingInstantiatorStrategy. It initializes the strategy without any specific parameters. ```java public SerializingInstantiatorStrategy() ``` -------------------------------- ### ObjenesisHelper Class Source: https://objenesis.org/apidocs/org/objenesis/package-summary.html Provides static utility methods for using Objenesis. ```APIDOC ## Class ObjenesisHelper ### Description Use Objenesis in a static way. This class offers convenient static methods to access Objenesis functionality without needing to instantiate an Objenesis object directly. ``` -------------------------------- ### PlatformDescription.isThisJVM Source: https://objenesis.org/apidocs/index-all.html Checks if the current Java Virtual Machine matches a specified JVM name. ```APIDOC ## PlatformDescription.isThisJVM ### Description Check if the current JVM is of the type passed in parameter. ### Method ```java public static boolean isThisJVM(String jvmName) ``` ### Parameters #### Path Parameters - **jvmName** (String) - Required - The name of the JVM to check against. ``` -------------------------------- ### InstantiatorStrategy Interface Methods Source: https://objenesis.org/apidocs/org/objenesis/strategy/BaseInstantiatorStrategy.html Details the methods inherited from the InstantiatorStrategy interface, which subclasses must implement. ```APIDOC ## Methods Inherited from InstantiatorStrategy ### newInstantiatorOf This method is part of the `InstantiatorStrategy` interface and is responsible for creating an `ObjectInstantiator` for a given class. ``` -------------------------------- ### SunReflectionFactorySerializationInstantiator Constructor Source: https://objenesis.org/apidocs/org/objenesis/instantiator/sun/SunReflectionFactorySerializationInstantiator.html Constructs a new SunReflectionFactorySerializationInstantiator for the given class type. ```APIDOC ## SunReflectionFactorySerializationInstantiator Constructor ### Description Constructs a new instance of `SunReflectionFactorySerializationInstantiator` for the specified class. ### Signature ```java public SunReflectionFactorySerializationInstantiator(Class type) ``` ### Parameters * **type** (Class) - The class for which to create an instantiator. ``` -------------------------------- ### newInstantiatorOf Method Source: https://objenesis.org/apidocs/org/objenesis/strategy/InstantiatorStrategy.html This method creates a dedicated instantiator for a specified class. It is the primary method for obtaining an ObjectInstantiator based on the strategy. ```APIDOC ## newInstantiatorOf Method ### Description Create a dedicated instantiator for the given class. ### Method Signature ` ObjectInstantiator newInstantiatorOf(Class type)` ### Type Parameters * `T` - Type to instantiate ### Parameters * `type` (Class) - The class that will be instantiated. ### Returns * `ObjectInstantiator` - A dedicated instantiator for the specified class. ``` -------------------------------- ### BaseInstantiatorStrategy Class Source: https://objenesis.org/apidocs/org/objenesis/strategy/package-summary.html A base class for Objenesis instantiator strategies, providing common functionality. ```APIDOC ## Class: BaseInstantiatorStrategy ### Description Base `InstantiatorStrategy` class basically. ``` -------------------------------- ### Interface Hierarchy Source: https://objenesis.org/apidocs/org/objenesis/instantiator/package-tree.html Details the inheritance structure for interfaces in the Objenesis instantiator package. ```APIDOC ## Interface Hierarchy * org.objenesis.instantiator.ObjectInstantiator ``` -------------------------------- ### ObjenesisBase Class Source: https://objenesis.org/apidocs/index-all.html ObjenesisBase is a concrete implementation of the Objenesis interface, offering a practical way to instantiate objects. ```APIDOC ## ObjenesisBase Class ### Description An implementation of the Objenesis interface that creates new objects without calling constructors. ### Method Signature `newInstance(Class)` ### Parameters * **Class** - The class for which to create a new instance. ### Response * **T** - A new instance of the specified class. ```