/*
 Tries each handler for the given parameter and returns a success boolean
  */
 private boolean parseKV(String key, String value) throws Exception {
   boolean success = false;
   // must have a registered handler; see registerArgumentHandler()
   if (!parameters.containsKey(key)) {
     throw new Exception(key + " is not a valid argument");
   }
   Argument arg = parameters.get(key);
   // don't allow dupes
   if (arg.getValue() != null) {
     throw new Exception("Duplicate arguments: " + key);
   }
   try {
     // handler returns null if it can't handle the argument
     // it can throw an exception if the argument is an unacceptable value
     Object param = arg.getHandler().tryArgument(value);
     if (param != null) {
       arg.setValue(param);
       success = true;
     }
   } catch (Exception e) {
     throw new Exception("Bad argument value for '" + key + "': " + e.getMessage());
   }
   return success;
 }