[ 
https://issues.apache.org/jira/browse/CAMEL-15437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-15437:
--------------------------------
    Fix Version/s: 3.5.0

> properties-binding: support binding from maps of maps
> -----------------------------------------------------
>
>                 Key: CAMEL-15437
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15437
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.5.0
>
>
> 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:
> {code:java}
> class Bar {
>     String name;
> }
> class Foo {
>     Bar bar;
> }
> {code}
> The it would be nice if we can bind from map like:
> {code:java}
> Map<Object, Object> properties = Map.of(
>     Map.of(
>         "bar",
>         Map.of("name", "test")
>     )
> );
> {code}
> Then one could use PropertyBindingSupport as usual:
> {code:java}
> Foo target = new Foo();
> PropertyBindingSupport.build()
>     .withCamelContext(context)
>     .withTarget(target)
>     .withProperties(properties)
>     .withRemoveParameters(false)
>     .bind();
> {code}
> The same copde using flat properties would look like:
> {code:java}
> Foo target = new Foo();
> PropertyBindingSupport.build()
>     .withCamelContext(context)
>     .withTarget(target)
>     .withProperties("bar.name", "test")
>     .withRemoveParameters(false)
>     .bind();
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to