public static Object createInstanceByType ( Class < ? > type , Object ... args ) throws Exception { if ( args . length == 0 ) { Constructor < ? > constructor = type . getConstructor ( ) ; return constructor . newInstance ( ) ; } else { throw new UnsupportedException ( null , "NOT_SUPPORTED" , "Constructors with parameters are not supported" ) ; } }
Creates an instance of an object type .