Class ProxyingInstantiator<T>

java.lang.Object
org.objenesis.instantiator.exotic.ProxyingInstantiator<T>
All Implemented Interfaces:
org.objenesis.instantiator.ObjectInstantiator<T>

@Instantiator(STANDARD) public class ProxyingInstantiator<T> extends Object implements org.objenesis.instantiator.ObjectInstantiator<T>
This instantiator creates a class by dynamically extending it. It will skip the call to the parent constructor in the bytecode. So that the constructor is indeed not called but you however instantiate a child class, not the actual class. The class loader will normally throw a VerifyError is you do that. However, using -Xverify:none should make it work
Author:
Henri Tremblay
  • Constructor Details

    • ProxyingInstantiator

      public ProxyingInstantiator(Class<T> type)
  • Method Details

    • newInstance

      public T newInstance()
      Specified by:
      newInstance in interface org.objenesis.instantiator.ObjectInstantiator<T>