| 
Groovy 1.8.5 | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgroovy.json.JsonSlurper
public class JsonSlurper extends Object
JSON slurper which parses text or reader content into a data structure of lists and maps.
 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"
 
| Method Summary | |
|---|---|
            Object
         | 
        
            parse(Reader reader)
            Parse a JSON data structure from content from a reader  | 
        
            Object
         | 
        
            parseText(String text)
            Parse a text representation of a JSON data structure  | 
        
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll | 
| Method Detail | 
|---|
public Object parse(Reader reader)
reader -  reader over a JSON content
public Object parseText(String text)
text -  JSON text to parse
Copyright © 2003-2011 The Codehaus. All rights reserved.