This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.4.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.4.x by this push:
new e1d9339 Argh regen added to much in last commit
e1d9339 is described below
commit e1d93393f37fe61ee6b9230f8b41ba6851498e8c
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Aug 25 10:09:34 2020 +0200
Argh regen added to much in last commit
---
.../camel/support/PropertyBindingSupport.java | 53 +---------------------
1 file changed, 1 insertion(+), 52 deletions(-)
diff --git
a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index c000322..650b0f4 100644
---
a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++
b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -84,7 +84,6 @@ public final class PropertyBindingSupport {
private CamelContext camelContext;
private Object target;
private Map<String, Object> properties;
- private Map<String, Map<String, Object>> map;
private boolean removeParameters = true;
private boolean mandatory;
private boolean nesting = true;
@@ -129,21 +128,6 @@ public final class PropertyBindingSupport {
}
/**
- * The map of map that holds the properties to use.
- */
- public Builder map(Map<String, Map<String, Object>> map) {
- if (this.map == null) {
- this.map = map;
- } else {
- // there may be existing options so add those if missing
- // we need to mutate existing as we are may be removing bound
properties
- this.map.forEach(map::putIfAbsent);
- this.map = map;
- }
- return this;
- }
-
- /**
* Adds property to use for binding
*/
public Builder withProperty(String key, Object value) {
@@ -255,12 +239,9 @@ public final class PropertyBindingSupport {
org.apache.camel.util.ObjectHelper.notNull(camelContext,
"camelContext");
org.apache.camel.util.ObjectHelper.notNull(target, "target");
- if ((properties == null || properties.isEmpty()) && (map == null
|| map.isEmpty())) {
+ if (properties == null || properties.isEmpty()) {
return false;
}
- if (properties != null && map != null) {
- throw new IllegalArgumentException("Only either properties or
map can be used, not both at the same time");
- }
return doBindProperties(camelContext, target, removeParameters ?
properties : new HashMap<>(properties),
optionPrefix, ignoreCase, true, mandatory,
@@ -280,44 +261,12 @@ public final class PropertyBindingSupport {
Object obj = target != null ? target : this.target;
Map<String, Object> prop = properties != null ? properties :
this.properties;
- // flattern map as facade for doBindProperties
- Map<String, Object> facade = flatternMapToProperties(map);
-
return doBindProperties(context, obj, removeParameters ? prop :
new HashMap<>(prop),
optionPrefix, ignoreCase, true, mandatory,
nesting, deepNesting, fluentBuilder, allowPrivateSetter,
reference, placeholder, configurer);
}
/**
- * Binds the properties to the target object, and removes the property
that was bound from properties.
- *
- * @param camelContext the camel context
- * @param target the target object
- * @param map the map of map that holds the properties to use
- * @return true if one or more properties was bound
- */
- public boolean bind(CamelContext camelContext, Object target,
Map<String, Map<String, Object>> map) {
- CamelContext context = camelContext != null ? camelContext :
this.camelContext;
- Object obj = target != null ? target : this.target;
- Map<String, Map<String, Object>> prop = map != null ? map :
this.map;
- if (!removeParameters) {
- prop = new HashMap<>(prop);
- }
-
- // flattern map as facade for doBindProperties
- Map<String, Object> facade = flatternMapToProperties(map);
-
- return doBindProperties(context, obj, facade,
- optionPrefix, ignoreCase, true, mandatory,
- nesting, deepNesting, fluentBuilder, allowPrivateSetter,
reference, placeholder, reflection, configurer);
- }
-
- private static Map<String, Object> flatternMapToProperties(Map<String,
Map<String, Object>> map) {
- // TODO:
-
- }
-
- /**
* Binds the property to the target object.
*
* @param camelContext the camel context