Class EvaluationContextImpl
java.lang.Object
com.jayway.jsonpath.internal.path.EvaluationContextImpl
- All Implemented Interfaces:
EvaluationContext
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Configuration
private final boolean
private final Path
private final Object
private int
private final Object
private final Object
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluationContextImpl
(Path path, Object rootDocument, Configuration configuration, boolean forUpdate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
<T> T
getPath()
Returns the list of formalized paths that represent the result of the evaluationConvenience method to get list of hits as String path representations<T> T
getValue()
This method does not adhere to configuration settings.<T> T
getValue
(boolean unwrap) options()
The json document that is evaluated
-
Field Details
-
configuration
-
valueResult
-
pathResult
-
path
-
rootDocument
-
updateOperations
-
documentEvalCache
-
forUpdate
private final boolean forUpdate -
resultIndex
private int resultIndex
-
-
Constructor Details
-
EvaluationContextImpl
public EvaluationContextImpl(Path path, Object rootDocument, Configuration configuration, boolean forUpdate)
-
-
Method Details
-
documentEvalCache
-
forUpdate
public boolean forUpdate() -
addResult
-
jsonProvider
-
options
-
configuration
- Specified by:
configuration
in interfaceEvaluationContext
- Returns:
- the configuration used for this evaluation
-
rootDocument
Description copied from interface:EvaluationContext
The json document that is evaluated- Specified by:
rootDocument
in interfaceEvaluationContext
- Returns:
- the document
-
updateOperations
- Specified by:
updateOperations
in interfaceEvaluationContext
-
getValue
public <T> T getValue()Description copied from interface:EvaluationContext
This method does not adhere to configuration settings. It will return a single object (not wrapped in a List) even if the configuration contains theOption.ALWAYS_RETURN_LIST
- Specified by:
getValue
in interfaceEvaluationContext
- Type Parameters:
T
- expected return type- Returns:
- evaluation result
-
getValue
public <T> T getValue(boolean unwrap) Description copied from interface:EvaluationContext
- Specified by:
getValue
in interfaceEvaluationContext
- Type Parameters:
T
- expected return type- Parameters:
unwrap
- tells th underlying json provider if primitives should be unwrapped- Returns:
- evaluation result
-
getPath
public <T> T getPath()Description copied from interface:EvaluationContext
Returns the list of formalized paths that represent the result of the evaluation- Specified by:
getPath
in interfaceEvaluationContext
- Type Parameters:
T
-- Returns:
- list of paths
-
getPathList
Description copied from interface:EvaluationContext
Convenience method to get list of hits as String path representations- Specified by:
getPathList
in interfaceEvaluationContext
- Returns:
- list of path representations
-