Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
The properties binding component now support flat properties onlyso if oyu need to bind nesting object, you need to use an OGNL like syntax but it would be nice to support also "map of maps" as example to do the binding from as example JSON.
Assuming we have a class like:
class Bar { String name; } class Foo { Bar bar; }
The it would be nice if we can bind from map like:
Map<Object, Object> properties = Map.of( Map.of( "bar", Map.of("name", "test") ) );
Then one could use PropertyBindingSupport as usual:
Foo target = new Foo(); PropertyBindingSupport.build() .withCamelContext(context) .withTarget(target) .withProperties(properties) .withRemoveParameters(false) .bind();
The same copde using flat properties would look like:
Foo target = new Foo(); PropertyBindingSupport.build() .withCamelContext(context) .withTarget(target) .withProperties("bar.name", "test") .withRemoveParameters(false) .bind();
Attachments
Issue Links
- links to