Package com.jayway.jsonpath
Interface ReadContext
- All Known Subinterfaces:
DocumentContext
- All Known Implementing Classes:
JsonContext
public interface ReadContext
-
Method Summary
Modifier and TypeMethodDescriptionReturns the configuration used for reading<T> T
json()
Returns the JSON model that this context is operating onReturns the JSON model that this context is operating on as a JSON stringlimit
(int maxResults) Stops evaluation when maxResults limit has been reached<T> T
Reads the given path from this context<T> T
Reads the given path from this context Sample code to create a TypeRefTypeRef ref = new TypeRefinvalid input: '<'List
>() {}; <T> T
Reads the given path from this context<T> T
Reads the given path from this context<T> T
Reads the given path from this context Sample code to create a TypeRefTypeRef ref = new TypeRefinvalid input: '<'List
>() {}; <T> T
Reads the given path from this contextwithListeners
(EvaluationListener... listener) Adds listener to the evaluation of this path
-
Method Details
-
configuration
Configuration configuration()Returns the configuration used for reading- Returns:
- an immutable configuration
-
json
<T> T json()Returns the JSON model that this context is operating on- Returns:
- json model
-
jsonString
String jsonString()Returns the JSON model that this context is operating on as a JSON string- Returns:
- json model as string
-
read
Reads the given path from this context- Type Parameters:
T
-- Parameters:
path
- path to readfilters
- filters- Returns:
- result
-
read
Reads the given path from this context- Type Parameters:
T
-- Parameters:
path
- path to readtype
- expected return type (will try to map)filters
- filters- Returns:
- result
-
read
Reads the given path from this context- Type Parameters:
T
-- Parameters:
path
- path to apply- Returns:
- result
-
read
Reads the given path from this context- Type Parameters:
T
-- Parameters:
path
- path to applytype
- expected return type (will try to map)- Returns:
- result
-
read
Reads the given path from this context Sample code to create a TypeRefTypeRef ref = new TypeRefinvalid input: '<'List
>() {}; - Type Parameters:
T
-- Parameters:
path
- path to applytypeRef
- expected return type (will try to map)- Returns:
- result
-
read
Reads the given path from this context Sample code to create a TypeRefTypeRef ref = new TypeRefinvalid input: '<'List
>() {}; - Type Parameters:
T
-- Parameters:
path
- path to applytypeRef
- expected return type (will try to map)- Returns:
- result
-
limit
Stops evaluation when maxResults limit has been reached- Parameters:
maxResults
-- Returns:
- the read context
-
withListeners
Adds listener to the evaluation of this path- Parameters:
listener
- listeners to add- Returns:
- the read context
-