You can add Processor[1] or bean method[2] to do the job here.

[1]http://camel.apache.org/processor.html

[2]http://camel.apache.org/bean.html 

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Friday, October 26, 2012 at 5:51 PM, clakech wrote:

> Hi,
> 
> I would like to unmarshal a Json to a Map/List of Strings (eg Map<String,
> Map&lt;String, Maps>>...)
> 
> Here is my input:
> {"pointsOfSale":
> {"pointOfSale":[
> {"href":"\/pointsOfSale\/UUID.0abc2aca-7930-4c9e-9f38-8af3d0692e04",
> "model":{"href":"\/models\/modelePointOfSale",
> "modelType":{"href":"\/modelTypes\/pointOfSale"}},
> "source":{"href":"\/sources\/TEST"},
> "attribute":[
> {"code":"pointOfSalePhysical","value":true},
> {"code":"mail","value":"Mail1"},
> {"code":"adresse","value":"address1"}]},
> {"href":"\/pointsOfSale\/UUID.a12e7adf-652a-4197-91bf-d4785e43f09f",
> "model":{"href":"\/models\/modelePointOfSale",
> "modelType":{"href":"\/modelTypes\/pointOfSale"}},
> "source":{"href":"\/sources\/Wikeo"},
> "attribute":[
> {"code":"pointOfSalePhysical","value":false},
> {"code":"mail","value":"Mail1"},
> {"code":"adresseMateriau","value":"Material address1"}]}
> }}
> 
> I would like to be able to do "something" like this after unmarshaling:
> 
> myJsonMapped.get("pointsOfSale").get("pointOfSale").get(0).get("source").get("href").equals("\/sources\/TEST")
> == true
> 
> For instance, with Gson we can do this kind of decoding:
> 
> new Gson().fromJson(json, Map.class);
> 
> I know I can do this with a simple bean or processor etc...
> 
> I just want to know of I can do this more efficiently with a native JSON
> camel component config
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/unmarshal-JSON-to-Map-List-of-Strings-tp5721600.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to