Here's an example demonstrating how to use JSON.get() to access nested map 
properties by path:

package org.apache.pivot.tests;

import org.apache.pivot.collections.Map;
import org.apache.pivot.json.JSON;
import org.apache.pivot.json.JSONSerializer;

public class JSONPathTest {
    public static void main(String[] args) throws Exception {
        Map<String, ?> map = JSONSerializer.parseMap("{data:{group:'My 
Group'}}");
        System.out.println(JSON.get(map, "data.group"));
    }
}

When the program is executed, "My Group" is written to the console.

Hope this helps.

G

On Jun 22, 2011, at 5:19 PM, Edvin Syse wrote:

> I created an issue and attached a patch, I hope you will concider it. I think 
> it is very in line with the "it just works as expected" feeling I get from 
> using Pivot :)
> 
> https://issues.apache.org/jira/browse/PIVOT-764
> 
> -- Edvin

Reply via email to