You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/10/11 09:07:34 UTC
[camel-spring-boot] branch main updated: CAMEL-18600: properties component - Allow to turn off nested placeholders
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new 584b617d604 CAMEL-18600: properties component - Allow to turn off nested placeholders
584b617d604 is described below
commit 584b617d6042c5acffdcbf25be754127776fdc02
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Oct 11 11:07:25 2022 +0200
CAMEL-18600: properties component - Allow to turn off nested placeholders
---
core/camel-spring-boot/src/main/docs/spring-boot.json | 7 +++++++
.../properties/PropertiesComponentAutoConfiguration.java | 3 +++
.../boot/properties/PropertiesComponentConfiguration.java | 13 +++++++++++++
3 files changed, 23 insertions(+)
diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json
index 4a816343ccb..f4f3d3b1ecd 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -381,6 +381,13 @@
"description": "A list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and only use the locations from this option.",
"sourceType": "org.apache.camel.spring.boot.properties.PropertiesComponentConfiguration"
},
+ {
+ "name": "camel.component.properties.nested-placeholder",
+ "type": "java.lang.Boolean",
+ "description": "Whether to support nested property placeholders. A nested placeholder, means that a placeholder, has also a placeholder, that should be resolved (recursively).",
+ "sourceType": "org.apache.camel.spring.boot.properties.PropertiesComponentConfiguration",
+ "defaultValue": false
+ },
{
"name": "camel.component.properties.override-properties",
"type": "java.lang.String",
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentAutoConfiguration.java
index 931398daadb..d943b7221c5 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentAutoConfiguration.java
@@ -69,6 +69,9 @@ public class PropertiesComponentAutoConfiguration {
if (configuration.getIgnoreMissingLocation() != null) {
component.setIgnoreMissingLocation(configuration.getIgnoreMissingLocation());
}
+ if (configuration.getNestedPlaceholder() != null) {
+ component.setNestedPlaceholder(configuration.getNestedPlaceholder());
+ }
if (configuration.getLocation() != null) {
component.setLocation(configuration.getLocation());
}
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentConfiguration.java
index 0443fadcb86..6f290d97072 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/properties/PropertiesComponentConfiguration.java
@@ -52,6 +52,11 @@ public class PropertiesComponentConfiguration {
* properties file not found.
*/
private Boolean ignoreMissingLocation = false;
+ /**
+ * Whether to support nested property placeholders. A nested placeholder, means that a placeholder, has also a
+ * placeholder, that should be resolved (recursively).
+ */
+ private Boolean nestedPlaceholder = false;
/**
* Sets initial properties which will be used before any locations are
* resolved. The option is a java.util.Properties type.
@@ -123,6 +128,14 @@ public class PropertiesComponentConfiguration {
this.ignoreMissingLocation = ignoreMissingLocation;
}
+ public Boolean getNestedPlaceholder() {
+ return nestedPlaceholder;
+ }
+
+ public void setNestedPlaceholder(Boolean nestedPlaceholder) {
+ this.nestedPlaceholder = nestedPlaceholder;
+ }
+
public String getInitialProperties() {
return initialProperties;
}