public static Object buildObjectInstance ( Class < ? > clazz ) { Object rets = null ; try { rets = clazz . newInstance ( ) ; } catch ( Exception e ) { throw new BundlingProcessException ( e . getMessage ( ) + " [The custom class " + clazz . getName ( ) + " could not be instantiated, check whether it is available on the classpath and" + " verify that it has a zero-arg constructor].\n" + " The specific error message is: " + e . getClass ( ) . getName ( ) + ":" + e . getMessage ( ) , e ) ; } return rets ; }
Builds a class instance using reflection by using its class . The class must have a zero - arg constructor .