String value =
curValue.getAttributes().getNamedItem("value").getNodeValue();
try {
if (mapping.containsKey(name)) {
throw new XPathExpressionException("The parameter " + name
+ " is defined multiple times!");
}
Object convertedValue = checkParameterValue(name, value, parameters);
if (convertedValue == null) {
throw new XPathExpressionException("The parameter " + name
+ " is not defined!");
}
mapping.put(name, convertedValue);
} catch (Exception e) {
throw new XPathExpressionException("The value of the parameter " + name
+ " does not match the parameter type!" + e);
}
}
// add default values of missing primitive parameters
for (IParameter parameter : parameters) {
if (parameter.isRequired() && parameter.getPluginType().isEmpty()
&& !mapping.containsKey(parameter.getName())) {
if (parameter.getDefaultValue().isEmpty()) {
throw new XPathExpressionException(
"Parameter "
+ parameter.getName()
+ " is not specified within the configuration and has no default value!");
}
mapping.put(parameter.getName(), parameter.getDefaultValue());