コード例 #1
0
 /**
  * Should parse a string to select, initialize, and return the user interface selected
  *
  * @param optionValue the string to parse
  * @return the user interface to use
  */
 private void selectUI(String optionValue) {
   try {
     Class<?> cls = Class.forName("com.kpro.ui." + optionValue);
     userInterface = (UserIO) cls.newInstance();
   } catch (Exception e) {
     System.err.println("Selected UserIO not found");
   }
 }