sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Edelson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SLING-3368) Simplify JSONObject and JSONArray access
Date Tue, 04 Feb 2014 15:36:10 GMT

    [ https://issues.apache.org/jira/browse/SLING-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13890774#comment-13890774
] 

Justin Edelson commented on SLING-3368:
---------------------------------------

Oooh. I like that idea. To be clear, it is still an (relatively minor) API change as JSONObject
and JSONArray would implement Adaptable. While it is possible to use the AdapterManager on
objects which do not implement the Adaptable interface, it's not all that pleasant (nor IMHO
intuitive):

{code}
adapterManager.getAdapter(jsonObject, Map.class);
{code}

I'd suggest that the first implementation be immutable collections.


> Simplify JSONObject and JSONArray access
> ----------------------------------------
>
>                 Key: SLING-3368
>                 URL: https://issues.apache.org/jira/browse/SLING-3368
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>            Reporter: Nicolas Peltier
>            Priority: Minor
>         Attachments: [json]_add_other_ways_to_use_JSONArray_and_JSONObject.patch
>
>
> Map JSONObject.toMap and JSONArray implementing Iterable allows better usage of those
classes.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message