diff --git a/src/main/java/org/ohdsi/webapi/check/builder/AbstractForEachValidatorBuilder.java b/src/main/java/org/ohdsi/webapi/check/builder/AbstractForEachValidatorBuilder.java index ea93a7c0c..b19b3ce3b 100644 --- a/src/main/java/org/ohdsi/webapi/check/builder/AbstractForEachValidatorBuilder.java +++ b/src/main/java/org/ohdsi/webapi/check/builder/AbstractForEachValidatorBuilder.java @@ -41,9 +41,34 @@ public final AbstractForEachValidatorBuilder groups(ValidatorGroupBuilder< } protected List> initGroups() { - return initAndBuildList(this.validatorGroupBuilders); + return initAndBuildGroupList(this.validatorGroupBuilders); } + // Note: exact same functionality as initAndBuildList, just needed a different call signature. + // This method was added to enable development using Eclipse + private List> initAndBuildGroupList(List> builders) { + + builders.forEach(builder -> { + if (Objects.isNull(builder.getBasePath())) { + builder.basePath(createChildPath()); + } + if (Objects.isNull(builder.getErrorMessage())) { + builder.errorMessage(this.errorMessage); + } + if (Objects.isNull(builder.getSeverity())) { + builder.severity(this.severity); + } + if (Objects.isNull(builder.getAttrName())) { + builder.attrName(this.attrName); + } + }); + return builders.stream() + .map(ValidatorBaseBuilder::build) + .collect(Collectors.toList()); + + + } + protected List> initValidators() { return initAndBuildList(this.validatorBuilders); } @@ -70,4 +95,4 @@ private List initAndBuildList(List build() { - List> groups = initAndBuildList(this.validatorGroupBuilders); + List> groups = initAndBuildGroupList(this.validatorGroupBuilders); List> validators = initAndBuildList(this.validatorBuilders); return new ValidatorGroup<>(validators, groups, valueGetter, conditionGetter); } + // Note: exact same functionality as initAndBuildList, just needed a different call signature. + // This method was added to enable development using Eclipse + private List> initAndBuildGroupList(List> builders) { + + builders.forEach(builder -> { + if (Objects.nonNull(this.errorMessage)) { + builder.errorMessage(this.errorMessage); + } + if (Objects.isNull(builder.getBasePath())) { + builder.basePath(createChildPath()); + } + if (Objects.isNull(builder.severity)) { + builder.severity(this.severity); + } + }); + return builders.stream() + .map(ValidatorBaseBuilder::build) + .collect(Collectors.toList()); + + + } + private List initAndBuildList(List> builders) { builders.forEach(builder -> { @@ -89,4 +111,4 @@ private List initAndBuildList(List