aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/config')
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java33
-rw-r--r--src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java43
2 files changed, 43 insertions, 33 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java b/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java
deleted file mode 100644
index 01d13f5..0000000
--- a/src/main/java/at/gv/egiz/moazs/config/DeliveryRequestAugmenterConfig.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package at.gv.egiz.moazs.config;
-
-import at.gv.egiz.moazs.preprocess.ConfigProfileGenerator;
-import at.gv.egiz.moazs.preprocess.ConfigProfileMerger;
-import at.gv.egiz.moazs.preprocess.ConfigProfileValidator;
-import at.gv.zustellung.app2mzs.xsd.ConfigType;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.ConfigurableEnvironment;
-
-import java.util.Map;
-
-@Configuration
-public class DeliveryRequestAugmenterConfig {
-
- @Bean
- @Autowired
- public Map<String, ConfigType> deliveryRequestConfigs(ConfigProfileGenerator generator) {
- return generator.generate();
- }
-
- @Value("${verify-completeness-of-default-delivery-request-configuration:true}")
- private boolean verifyCompletenessOfDefaultConfiguration;
-
- @Bean
- @Autowired
- public ConfigProfileGenerator configProfileGenerator(ConfigurableEnvironment env, ConfigProfileMerger merger, ConfigProfileValidator validator) {
- return new ConfigProfileGenerator(env, merger, verifyCompletenessOfDefaultConfiguration, validator);
- }
-
-}
diff --git a/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java b/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java
new file mode 100644
index 0000000..ce40691
--- /dev/null
+++ b/src/main/java/at/gv/egiz/moazs/config/PreprocessConfig.java
@@ -0,0 +1,43 @@
+package at.gv.egiz.moazs.config;
+
+import at.gv.egiz.moazs.preprocess.*;
+import at.gv.zustellung.app2mzs.xsd.ConfigType;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.Map;
+
+import static at.gv.egiz.moazs.preprocess.ConfigProfileGenerator.configProfileGeneratorBuilder;
+
+@Configuration
+public class PreprocessConfig {
+
+ @Bean
+ @Autowired
+ public Map<String, ConfigType> deliveryRequestConfigs(ConfigProfileGenerator generator) {
+ return generator.generate();
+ }
+
+ @Value("${verify-completeness-of-default-delivery-request-configuration:true}")
+ private boolean verifyCompletenessOfDefaultConfiguration;
+
+ @Bean
+ @Autowired
+ public ConfigProfileGenerator configProfileGenerator(
+ SpringPropertiesFacade properties,
+ MapToConfigConverter converter,
+ ConfigProfileValidator validator,
+ ConfigProfileMerger merger) {
+
+ return configProfileGeneratorBuilder()
+ .withProperties(properties)
+ .withConverter(converter)
+ .withValidator(validator)
+ .withMerger(merger)
+ .withVerifyCompletenessOfDefaultConfiguration(verifyCompletenessOfDefaultConfiguration)
+ .build();
+ }
+
+}