Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否考虑List类型数据支持数组操作? #11

Closed
zhaolic39 opened this issue Nov 22, 2017 · 1 comment
Closed

是否考虑List类型数据支持数组操作? #11

zhaolic39 opened this issue Nov 22, 2017 · 1 comment

Comments

@zhaolic39
Copy link

例:

        JSONObject json = new JSONObject();
        json.put("attr", Lists.newArrayList("1", "2", "3"));

        DefaultContext<String, Object> properties = new DefaultContext<String, Object>();
        properties.put("json", json);

        String ex = "json.attr.get(1)";
        Object r = runner.execute(ex, properties, null, true, false);
        System.out.println(r);

        //是否可以支持下面的操作?
//        ex = "json.attr[1]";
//        r = runner.execute(ex, properties, null, true, false);
//        System.out.println(r);
@baoxingjie
Copy link
Contributor

是一个不错的语法糖,虽然不是符合java规范的,后面我们会综合考虑一下,比如map['a'],map[0],array[0]等都统一支持下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants