You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/08/25 07:40:00 UTC

[jira] [Assigned] (CAMEL-15437) properties-binding: support binding from maps of maps

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

Claus Ibsen reassigned CAMEL-15437:
-----------------------------------

    Assignee: Claus Ibsen

> 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
>
> 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)