commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "The Alchemist (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CONFIGURATION-258) JSON configuration
Date Wed, 19 Apr 2017 18:30:42 GMT

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

The Alchemist edited comment on CONFIGURATION-258 at 4/19/17 6:30 PM:
----------------------------------------------------------------------

@[~joehni]: Good call.  If we limit ourselves to Java 8, we can use [ScriptObjectMirror.wrapAsJSONCompatible()|https://docs.oracle.com/javase/8/docs/jdk/api/nashorn/jdk/nashorn/api/scripting/ScriptObjectMirror.html#wrapAsJSONCompatible-java.lang.Object-java.lang.Object-]
but it seems like an external library is the way to go.

I was thinking about using the [org.json|http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.json%22%20AND%20a%3A%22json%22]
library which is nice and small, but it gave me too much trouble, so I've attached a patch
that uses Jackson's JSON support.

P.S. I was thinking about creating a separate {{commons-configuration2-jackson}} module, but
the package structure isn't really conducive to that.  Ideally, everything out of the root
module and turn it into type POM.


was (Author: the_alchemist):
@[~joehni]: Good call.  If we limit ourselves to Java 8, we can use [ScriptObjectMirror.wrapAsJSONCompatible()|https://docs.oracle.com/javase/8/docs/jdk/api/nashorn/jdk/nashorn/api/scripting/ScriptObjectMirror.html#wrapAsJSONCompatible-java.lang.Object-java.lang.Object-]
but it seems like an external library is the way to go.

The [org.json|http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.json%22%20AND%20a%3A%22json%22]
is nice small library (~55KB).  Any objections to that?

> JSON configuration
> ------------------
>
>                 Key: CONFIGURATION-258
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-258
>             Project: Commons Configuration
>          Issue Type: New Feature
>          Components: Format
>    Affects Versions: 1.3
>            Reporter: Antonio López-Cerón Vivo
>            Priority: Minor
>             Fix For: 2.x
>
>
> JSON  is a lightweight data-interchange format
> {code}
> {"menu": {
>   "id": "file",
>   "value": "File",
>   "popup": {
>     "menuitem": [
>       {"value": "New", "onclick": "CreateNewDoc()"},
>       {"value": "Open", "onclick": "OpenDoc()"},
>       {"value": "Close", "onclick": "CloseDoc()"}
>     ]
>   }
> }}
> {code}
> All references can be located at
> http://www.json.org/



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message