nashorn maps js-array to java-map
This commit is contained in:
parent
e52b8d7308
commit
c4f3025c80
@ -2,6 +2,7 @@ package de.hsadmin.module.property.mapping;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import de.hsadmin.common.error.TechnicalException;
|
||||
import de.hsadmin.common.error.UserException;
|
||||
@ -35,6 +36,16 @@ public class DefaultStringSetParameterMapMapper implements
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
if (rpcParam instanceof Map<?, ?>) {
|
||||
final Map<?, ?> rpcParamMap = (Map<?, ?>) rpcParam;
|
||||
final Set<?> keySet = rpcParamMap.keySet();
|
||||
strings = new String[rpcParamMap.size()];
|
||||
for (int idx = 0; idx < strings.length; idx++) {
|
||||
final Object object = keySet.toArray()[idx];
|
||||
final String val = (String) rpcParamMap.get(object);
|
||||
strings[idx] = val;
|
||||
}
|
||||
}
|
||||
value.setStrings(strings);
|
||||
return value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user