Minor improvement for dataset prefilling
This commit is contained in:
parent
e1a4a64d81
commit
1d68b2a379
|
@ -327,10 +327,11 @@ public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel
|
|||
if (prefillingMapping.getTarget() != null) {
|
||||
try {
|
||||
String methodName = "set" + prefillingMapping.getTarget().substring(0, 1).toUpperCase(Locale.ROOT) + prefillingMapping.getTarget().substring(1);
|
||||
Method setterMethod = DatasetWizardModel.class.getMethod(methodName, String.class);
|
||||
Method setterMethod = Arrays.stream(DatasetWizardModel.class.getDeclaredMethods())
|
||||
.filter(method -> method.getName().equals(methodName)).collect(Collectors.toList()).get(0);
|
||||
setterMethod.invoke(datasetWizardModel, sourceValue);
|
||||
}catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}catch (InvocationTargetException | IllegalAccessException e) {
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
List<JsonNode> nodes = JsonSearcher.findNodes(parentNode, "rdaProperty", prefillingMapping.getMaDmpTarget());
|
||||
|
|
Loading…
Reference in New Issue