Groovy web console

subscribe to the feed Subscribe
to this
site

All data type

Published 3 months ago by Amol Chavan
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.JsonSlurper
JsonSlurper jsonSlurper = new JsonSlurper()
String allDataType = '''
{ "simple": 123,
"fraction": 123.66,
"exponential": 123e12,
"null":null,
"boolean":true
}'''

Object result2 = jsonSlurper.parseText(allDataType )
println (result2.keySet())