com.jayway.jsonpath
Class JsonModel

java.lang.Object
  extended by com.jayway.jsonpath.JsonModel

public class JsonModel
extends Object

A JsonModel represents a parsed JSON document that provides easy and efficient read operations. In contrast to the static read operations provided by JsonPath a JsonModel will only parse the document once.

Author:
Kalle Stenflo

Nested Class Summary
static interface JsonModel.ArrayOps
           
static interface JsonModel.ListMappingModelReader
           
static interface JsonModel.MappingModelReader
           
static interface JsonModel.ObjectMappingModelReader
           
static interface JsonModel.ObjectOps
           
 
Method Summary
static JsonModel create(InputStream jsonInputStream)
           
static JsonModel create(Object jsonObject)
           
static JsonModel create(String json)
           
static JsonModel create(URL url)
           
<T> T
get(JsonPath jsonPath)
           
<T> T
get(String jsonPath, Filter... filters)
           
 String getJson()
           
 String getJson(JsonPath jsonPath)
           
 String getJson(String jsonPath, Filter... filters)
           
 Object getJsonObject()
           
 JsonModel getModel(JsonPath jsonPath)
           
 JsonModel getModel(String jsonPath, Filter... filters)
           
 JsonModel.MappingModelReader map(JsonPath jsonPath)
           
 JsonModel.MappingModelReader map(String jsonPath)
           
 JsonModel.ArrayOps opsForArray(JsonPath jsonPath)
           
 JsonModel.ArrayOps opsForArray(String jsonPath)
           
 JsonModel.ObjectOps opsForObject(JsonPath jsonPath)
           
 JsonModel.ObjectOps opsForObject(String jsonPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getJsonObject

public Object getJsonObject()

get

public <T> T get(String jsonPath,
                 Filter... filters)

get

public <T> T get(JsonPath jsonPath)

opsForArray

public JsonModel.ArrayOps opsForArray(String jsonPath)

opsForArray

public JsonModel.ArrayOps opsForArray(JsonPath jsonPath)

opsForObject

public JsonModel.ObjectOps opsForObject(String jsonPath)

opsForObject

public JsonModel.ObjectOps opsForObject(JsonPath jsonPath)

getJson

public String getJson()

getJson

public String getJson(String jsonPath,
                      Filter... filters)

getJson

public String getJson(JsonPath jsonPath)

getModel

public JsonModel getModel(String jsonPath,
                          Filter... filters)

getModel

public JsonModel getModel(JsonPath jsonPath)

map

public JsonModel.MappingModelReader map(String jsonPath)

map

public JsonModel.MappingModelReader map(JsonPath jsonPath)

create

public static JsonModel create(String json)

create

public static JsonModel create(Object jsonObject)

create

public static JsonModel create(URL url)
                        throws IOException
Throws:
IOException

create

public static JsonModel create(InputStream jsonInputStream)
                        throws IOException
Throws:
IOException


Copyright © 2011-2012. All Rights Reserved.