public interface ReadContext
Modifier and Type | Method and Description |
---|---|
Configuration |
configuration()
Returns the configuration used for reading
|
<T> T |
json()
Returns the JSON model that this context is operating on
|
String |
jsonString()
Returns the JSON model that this context is operating on as a JSON string
|
ReadContext |
limit(int maxResults)
Stops evaluation when maxResults limit has been reached
|
<T> T |
read(JsonPath path)
Reads the given path from this context
|
<T> T |
read(JsonPath path,
Class<T> type)
Reads the given path from this context
|
<T> T |
read(JsonPath path,
TypeRef<T> typeRef)
Reads the given path from this context
Sample code to create a TypeRef
TypeRef ref = new TypeRef |
<T> T |
read(String path,
Class<T> type,
Predicate... filters)
Reads the given path from this context
|
<T> T |
read(String path,
Predicate... filters)
Reads the given path from this context
|
<T> T |
read(String path,
TypeRef<T> typeRef)
Reads the given path from this context
Sample code to create a TypeRef
TypeRef ref = new TypeRef |
ReadContext |
withListeners(EvaluationListener... listener)
Adds listener to the evaluation of this path
|
Configuration configuration()
<T> T json()
String jsonString()
<T> T read(String path, Predicate... filters)
T
- path
- path to readfilters
- filters<T> T read(String path, Class<T> type, Predicate... filters)
T
- path
- path to readtype
- expected return type (will try to map)filters
- filters<T> T read(JsonPath path)
T
- path
- path to apply<T> T read(JsonPath path, Class<T> type)
T
- path
- path to applytype
- expected return type (will try to map)<T> T read(JsonPath path, TypeRef<T> typeRef)
TypeRef ref = new TypeRef>() {};
T
- path
- path to applytypeRef
- expected return type (will try to map)<T> T read(String path, TypeRef<T> typeRef)
TypeRef ref = new TypeRef>() {};
T
- path
- path to applytypeRef
- expected return type (will try to map)ReadContext limit(int maxResults)
maxResults
- ReadContext withListeners(EvaluationListener... listener)
listener
- listeners to addCopyright © 2024. All rights reserved.