From d9f39b27fe5da5f7ef94a17e4d8f1217b90745d4 Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 11 Jul 2024 15:12:27 -0400 Subject: [PATCH] Introduce backwards compatible constructor in ValidationEngineBuilder and deprecate (#1682) * Introduce backwards compatible constructor + deprecate args constructors * After review: fix useEcosystem set by param + deprecation annotation --- .../hl7/fhir/validation/ValidationEngine.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java index 4d6f6d4a8..a242ca2e9 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java @@ -342,6 +342,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP @With private boolean THO = true; + private static final boolean USE_ECOSYSTEM_DEFAULT = true; public ValidationEngineBuilder() { terminologyCachePath = null; @@ -352,10 +353,24 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP txVersion = null; timeTracker = null; canRunWithoutTerminologyServer = false; - useEcosystem = true; + useEcosystem = USE_ECOSYSTEM_DEFAULT; loggingService = new SystemOutLoggingService(); } + /** + * @deprecated This method will be removed in a future release, and should not be used outside of this class. + * Use {@link #ValidationEngineBuilder()} instead. + */ + @Deprecated + public ValidationEngineBuilder(String terminologyCachePath, String userAgent, String version, String txServer, String txLog, FhirPublication txVersion, TimeTracker timeTracker, boolean canRunWithoutTerminologyServer, ILoggingService loggingService, boolean THO) { + this(terminologyCachePath, userAgent, version, txServer, txLog, txVersion, USE_ECOSYSTEM_DEFAULT, timeTracker, canRunWithoutTerminologyServer, loggingService, THO); + } + + /** + * @deprecated This method will be made private in a future release, and should not be used outside of this class. + * Use {@link #ValidationEngineBuilder()} instead. + */ + @Deprecated public ValidationEngineBuilder(String terminologyCachePath, String userAgent, String version, String txServer, String txLog, FhirPublication txVersion, boolean useEcosystem, TimeTracker timeTracker, boolean canRunWithoutTerminologyServer, ILoggingService loggingService, boolean THO) { this.terminologyCachePath = terminologyCachePath; this.userAgent = userAgent; @@ -366,7 +381,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP this.timeTracker = timeTracker; this.canRunWithoutTerminologyServer = canRunWithoutTerminologyServer; this.loggingService = loggingService; - this.useEcosystem = true; + this.useEcosystem = useEcosystem; this.THO = THO; }