Hi all, As part of the Groovy 1.8 roadmap, we had an item for supporting JSON in Groovy, similarily as to how we support XML, namely by providing a parser (slurper) and a builder. I've implemented a Groovy JsonSlurper and JsonParser, in the groovy.json package. It's currently in Trunk. You can play with those parser and builder by using a snapshot of Groovy 1.8 that you can find on Bamboo, for exa
このシリーズの一覧はこちら はじめに 前回は自分でクラスを書いて対応していましたが、Groovyのv1.8からJSONは組み込みでサポートされるようになりました。 Groovy本家より この機能は既にGroovyにあるXMLの生成や読み込みをサポートするMarkupBuilder, XmlSlurper, XmlParserのJSON版と捉えると理解が早いです。 ということで、簡単なサンプルをご紹介します。 (動作確認: Groovy Version: 1.8.0-rc-1 JVM: 1.6.0_22) 準備 用意したjsonはこんな内容です。 json.txt [ ["aaa", "bbb", "ccc"], { "key1" : "value1", "key2" : "value2", "key3" : "value3", "key4" : "" }, ["ddd", "eee", "
Since version 2.0 Json-lib has integrated Groovy support, meaning that POGOs can be transformed into JSON and back, in the same manner as you do now with POJOs. There are other features as well: Type transformations with the as keyword. A Groovy List (default type is ArrayList) can be transformed into a JSONArray. A Groovy Map (default type is HashMap) can be transformed into a JSONObject. A Strin
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く