Class EvaluationContextImpl
- java.lang.Object
-
- com.jayway.jsonpath.internal.path.EvaluationContextImpl
-
- All Implemented Interfaces:
EvaluationContext
public class EvaluationContextImpl extends java.lang.Object implements EvaluationContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
EvaluationContextImpl.FoundResultImpl
-
Field Summary
Fields Modifier and Type Field Description private Configuration
configuration
private java.util.HashMap<Path,java.lang.Object>
documentEvalCache
private boolean
forUpdate
private Path
path
private java.lang.Object
pathResult
private int
resultIndex
private java.lang.Object
rootDocument
private java.util.List<PathRef>
updateOperations
private java.lang.Object
valueResult
-
Constructor Summary
Constructors Constructor Description EvaluationContextImpl(Path path, java.lang.Object rootDocument, Configuration configuration, boolean forUpdate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResult(java.lang.String path, PathRef operation, java.lang.Object model)
Configuration
configuration()
java.util.HashMap<Path,java.lang.Object>
documentEvalCache()
boolean
forUpdate()
<T> T
getPath()
Returns the list of formalized paths that represent the result of the evaluationjava.util.List<java.lang.String>
getPathList()
Convenience 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)
JsonProvider
jsonProvider()
java.util.Set<Option>
options()
java.lang.Object
rootDocument()
The json document that is evaluatedjava.util.Collection<PathRef>
updateOperations()
-
-
-
Field Detail
-
configuration
private final Configuration configuration
-
valueResult
private final java.lang.Object valueResult
-
pathResult
private final java.lang.Object pathResult
-
path
private final Path path
-
rootDocument
private final java.lang.Object rootDocument
-
updateOperations
private final java.util.List<PathRef> updateOperations
-
documentEvalCache
private final java.util.HashMap<Path,java.lang.Object> documentEvalCache
-
forUpdate
private final boolean forUpdate
-
resultIndex
private int resultIndex
-
-
Constructor Detail
-
EvaluationContextImpl
public EvaluationContextImpl(Path path, java.lang.Object rootDocument, Configuration configuration, boolean forUpdate)
-
-
Method Detail
-
documentEvalCache
public java.util.HashMap<Path,java.lang.Object> documentEvalCache()
-
forUpdate
public boolean forUpdate()
-
addResult
public void addResult(java.lang.String path, PathRef operation, java.lang.Object model)
-
jsonProvider
public JsonProvider jsonProvider()
-
options
public java.util.Set<Option> options()
-
configuration
public Configuration configuration()
- Specified by:
configuration
in interfaceEvaluationContext
- Returns:
- the configuration used for this evaluation
-
rootDocument
public java.lang.Object rootDocument()
Description copied from interface:EvaluationContext
The json document that is evaluated- Specified by:
rootDocument
in interfaceEvaluationContext
- Returns:
- the document
-
updateOperations
public java.util.Collection<PathRef> 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
- Returns:
- list of paths
-
getPathList
public java.util.List<java.lang.String> 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
-
-