package util; public final class Coerce { // NewInstanceByClassname( String ) /** * Given a String representing the name of a class, returns an * initilized instance of the corresponding class (as an object). * Throws CreationException if the indicated class cannot be * instantianted for any reason. */ public static final Object NewInstanceByClassname (String s) throws CreationException { try { Class c = Class.forName(s); return c.newInstance(); } catch (Exception e) { throw new CreationException(s + " could not be created"); } } }