code: protected
    Object convertArg(String val, Class type) {
      if(val == null)
        return null;
  
      String v = val.trim();
      if (String.class.isAssignableFrom(type)) {
        return val;
      } else if (Integer.TYPE.isAssignableFrom(type)) {
        return new Integer(v);
      } else if (Long.TYPE.isAssignableFrom(type)) {
        return new Long(v);
      } else if (Boolean.TYPE.isAssignableFrom(type)) {
        if ("true".equalsIgnoreCase(v)) {
          return Boolean.TRUE;
        } else if ("false".equalsIgnoreCase(v)) {
          return Boolean.FALSE;
        }
      } else if (Priority.class.isAssignableFrom(type)) {
        return OptionConverter.toLevel(v, (Level) Level.DEBUG);
      } else if (ErrorHandler.class.isAssignableFrom(type)) {
        return OptionConverter.instantiateByClassName(v,
  	  ErrorHandler.class, null);
      }
      return null;
    }
docs: Convert <code>val</code> a String parameter to an object of a
  given type.