Class EvaluationContextImpl
- java.lang.Object
-
- com.jayway.jsonpath.internal.path.EvaluationContextImpl
-
- All Implemented Interfaces:
EvaluationContext
public class EvaluationContextImpl extends java.lang.Object implements EvaluationContext
-
-
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 voidaddResult(java.lang.String path, PathRef operation, java.lang.Object model)Configurationconfiguration()java.util.HashMap<Path,java.lang.Object>documentEvalCache()booleanforUpdate()<T> TgetPath()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 representationsRootPathTokengetRoot()<T> TgetValue()This method does not adhere to configuration settings.<T> TgetValue(boolean unwrap)JsonProviderjsonProvider()java.util.Set<Option>options()java.lang.ObjectrootDocument()The json document that is evaluatedjava.util.Collection<PathRef>updateOperations()
-
-
-
Constructor Detail
-
EvaluationContextImpl
public EvaluationContextImpl(Path path, java.lang.Object rootDocument, Configuration configuration, boolean forUpdate)
-
-
Method Detail
-
getRoot
public RootPathToken getRoot()
-
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:
configurationin interfaceEvaluationContext- Returns:
- the configuration used for this evaluation
-
rootDocument
public java.lang.Object rootDocument()
Description copied from interface:EvaluationContextThe json document that is evaluated- Specified by:
rootDocumentin interfaceEvaluationContext- Returns:
- the document
-
updateOperations
public java.util.Collection<PathRef> 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- Returns:
- list of paths
-
getPathList
public java.util.List<java.lang.String> 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
-
-