/** * Reads given configuration property for a class name. It returns an instance of the class. The * class must implement a constructor that takes a String as an argument. The value of this string * will be <tt>name</tt>. The constructor of the class can see the configuration so it can make * use of this name to read its own parameters from it. * * @param name Name of configuration property * @param def The default object that is returned if there is no property defined with the given * name * @throws IllegalParameterException if the given name is defined but there is a problem creating * the instance. */ public static Object getInstance(String name, Object def) { return config.getInstance(name, def); }
/** * Reads given configuration property for a class name. It returns an instance of the class. The * class must implement a constructor that takes a String as an argument. The value of this string * will be <tt>name</tt>. The constructor of the class can see the configuration so it can make * use of this name to read its own parameters from it. * * @param name Name of configuration property * @throws MissingParameterException if the given property is not defined * @throws IllegalParameterException if there is any problem creating the instance */ public static Object getInstance(String name) { return config.getInstance(name); }