class MapInjectionResolver extends InjectionResolver<Param> {

    @Override
    public <V> V getValue(Object component, AnnotatedElement target, Type genericType, Class<V> type) throws MultiException {
	// look for the name in the list of parameters passed.
	Param param = target.getAnnotation(Param.class);
	String paramName = CommandModel.getParamName(param, target);
	if (param.primary()) {
	    // this is the primary parameter for the command
            List<String> value = parameters.get("DEFAULT");
	    if (value != null && value.size() > 0) {
                /*
                 * If the operands are uploaded files, replace the
                 * client-provided values with the paths to the uploaded files.
                 * XXX - assume the lists are in the same order.
                 */
                final List<String> filePaths = getUploadedFileParamValues(
                        "DEFAULT",
                        type, optionNameToUploadedFileMap);
                if (filePaths != null) {
                    value = filePaths;
                    // replace the file name operands with the uploaded files
                    parameters.set("DEFAULT", value); 
                } else {
                    for (String s : value) {
                        checkAgainstAcceptableValues(target, s);
                    }
                    
                }
		// let's also copy this value to the cmd with a real name
		parameters.set(paramName, value);
                V paramValue = (V) convertListToObject(target, type, value);
                return paramValue;
	    }
	}
        if (param.multiple()) {
            List<String> value = parameters.get(paramName);
            if (value != null && value.size() > 0) {
                final List<String> filePaths = getUploadedFileParamValues(
                        paramName,
                        type, optionNameToUploadedFileMap);
                if (filePaths != null) {
                    value = filePaths;
                    // replace the file name operands with the uploaded files
                    parameters.set(paramName, value); 
                } else {
                    for (String s : value) {
                        checkAgainstAcceptableValues(target, s);
                    }
                }
            }
            parameters.set(paramName, value);
            V paramValue = (V) convertListToObject(target, type, value);
            return paramValue;
        }
	String paramValueStr = getParamValueString(parameters, param, target, context);

        /*
         * If the parameter is an uploaded file, replace the client-provided
         * value with the path to the uploaded file.
         */
        final String fileParamValueStr = getUploadedFileParamValue(
                paramName, type, optionNameToUploadedFileMap);
        if (fileParamValueStr != null) {
            paramValueStr = fileParamValueStr;
            parameters.set(paramName, paramValueStr);
        }
	checkAgainstAcceptableValues(target, paramValueStr);
        
        return paramValueStr != null ?
                (V) convertStringToObject(target, type, paramValueStr) :
                (V) getParamField(component, target);
    }

    public  MapInjectionResolver(CommandModel model,
					ParameterMap parameters);
    public  MapInjectionResolver(CommandModel model,
					ParameterMap parameters,
                                        final MultiMap<String,File> optionNameToUploadedFileMap);

}