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 Configurationprivate final booleanprivate final Pathprivate final Objectprivate intprivate final Objectprivate final Object -
Constructor Summary
ConstructorsConstructorDescriptionEvaluationContextImpl(Path path, Object rootDocument, Configuration configuration, boolean forUpdate) -
Method Summary
Modifier and TypeMethodDescriptionvoidboolean<T> TgetPath()Returns the list of formalized paths that represent the result of the evaluationConvenience method to get list of hits as String path representations<T> TgetValue()This method does not adhere to configuration settings.<T> TgetValue(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:
configurationin interfaceEvaluationContext- Returns:
- the configuration used for this evaluation
-
rootDocument
Description copied from interface:EvaluationContextThe json document that is evaluated- Specified by:
rootDocumentin interfaceEvaluationContext- Returns:
- the document
-
updateOperations
- Specified by:
updateOperationsin interfaceEvaluationContext
-
getValue
public <T> T getValue()Description copied from interface:EvaluationContextThis 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:
getValuein interfaceEvaluationContext- Type Parameters:
T- expected return type- Returns:
- evaluation result
-
getValue
public <T> T getValue(boolean unwrap) Description copied from interface:EvaluationContext- Specified by:
getValuein 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:EvaluationContextReturns the list of formalized paths that represent the result of the evaluation- Specified by:
getPathin interfaceEvaluationContext- Type Parameters:
T-- Returns:
- list of paths
-
getPathList
Description copied from interface:EvaluationContextConvenience method to get list of hits as String path representations- Specified by:
getPathListin interfaceEvaluationContext- Returns:
- list of path representations
-