With http://objenesis.org/:
“Objenesis aims to overcome these restrictions by bypassing the constructor on object instantiation.”
(from http://objenesis.org/index.html)
Note: Spring (re)packs objensis in spring-core in the org.springframework.objenesis
package.
// simple but not recommended
ObjenesisHelper.newInstance(MyClass.class);
Objenesis objenesis = new ObjenesisStd();
ObjectInstantiator<MyClass> instantiator = objenesis.getInstantiatorOf(MyClass.class);
MyClass newInstance = instantiator.newInstance();
...