use of org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider in project mule by mulesoft.
the class ApplicationModel method createProviderFromGlobalProperties.
private ConfigurationPropertiesProvider createProviderFromGlobalProperties(ArtifactConfig artifactConfig) {
final Map<String, ConfigurationProperty> globalProperties = new HashMap<>();
artifactConfig.getConfigFiles().stream().forEach(configFile -> {
configFile.getConfigLines().get(0).getChildren().stream().forEach(configLine -> {
if (GLOBAL_PROPERTY.equals(configLine.getIdentifier())) {
String key = configLine.getConfigAttributes().get("name").getValue();
String rawValue = configLine.getConfigAttributes().get("value").getValue();
globalProperties.put(key, new DefaultConfigurationProperty(format("global-property - file: %s - lineNumber %s", configFile.getFilename(), configLine.getLineNumber()), key, rawValue));
}
});
});
return new GlobalPropertyConfigurationPropertiesProvider(globalProperties);
}
Aggregations