public static Object instantiate ( Class clazz ) throws InstantiationException { Object result = null ; try { result = ClassHelper . newInstance ( clazz ) ; } catch ( IllegalAccessException e ) { try { result = ClassHelper . newInstance ( clazz , true ) ; } catch ( Exception e1 ) { throw new ClassNotPersistenceCapableException ( "Can't instantiate class '" + ( clazz != null ? clazz . getName ( ) : "null" ) + "', message was: " + e1 . getMessage ( ) + ")" , e1 ) ; } } return result ; }
create a new instance of class clazz . first use the public default constructor . If this fails also try to use protected an private constructors .