* If the parameters could not be read.
*/
@SuppressWarnings("unchecked")
public void readParameters(Map<String, Object> parameters)
throws IOException {
Parameter param = readNextParameter();
Object currentValue = null;
while (param != null) {
if (parameters.containsKey(param.getName())) {
currentValue = parameters.get(param.getName());
if (currentValue != null) {
List<Object> values = null;
if (currentValue instanceof List) {
// Multiple values already found for this parameter
values = (List<Object>) currentValue;
} else {
// Second value found for this parameter
// Create a list of values
values = new ArrayList<Object>();
values.add(currentValue);
parameters.put(param.getName(), values);
}
if (param.getValue() == null) {
values.add(Series.EMPTY_VALUE);
} else {
values.add(param.getValue());
}
} else {
if (param.getValue() == null) {
parameters.put(param.getName(), Series.EMPTY_VALUE);
} else {
parameters.put(param.getName(), param.getValue());
}
}
}
param = readNextParameter();