public class JsonSlurper
extends java.lang.Object
Example usage:
def slurper = new JsonSlurper()
def result = slurper.parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')
assert result.person.name == "Guillaume"
assert result.person.age == 33
assert result.person.pets.size() == 2
assert result.person.pets[0] == "dog"
assert result.person.pets[1] == "cat"
Constructor and Description |
---|
JsonSlurper() |
public java.lang.Object parseText(java.lang.String text)
text
- JSON text to parsepublic java.lang.Object parse(java.io.Reader reader)
reader
- reader over a JSON content