Class JsonPathUpdateEvaluator
java.lang.Object
org.apache.nifi.attribute.expression.language.evaluation.StringEvaluator
org.apache.nifi.attribute.expression.language.evaluation.functions.JsonPathBaseEvaluator
org.apache.nifi.attribute.expression.language.evaluation.functions.JsonPathUpdateEvaluator
- Direct Known Subclasses:
JsonPathAddEvaluator
,JsonPathPutEvaluator
,JsonPathSetEvaluator
JsonPathUpdateEvaluator is base class for updating attributes
Subclasses need to implement
updateAttribute(com.jayway.jsonpath.DocumentContext, com.jayway.jsonpath.JsonPath, java.lang.Object)
method otherwise it throws NotImplementedException
-
Field Summary
Fields inherited from class org.apache.nifi.attribute.expression.language.evaluation.functions.JsonPathBaseEvaluator
EMPTY_RESULT, JSON_PROVIDER, jsonPathExp, precompiledJsonPathExp, STRICT_PROVIDER_CONFIGURATION, subject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionevaluate
(EvaluationContext context) com.jayway.jsonpath.DocumentContext
updateAttribute
(com.jayway.jsonpath.DocumentContext documentContext, com.jayway.jsonpath.JsonPath jsonPath, Object value) Update the attribute at the specified path.Methods inherited from class org.apache.nifi.attribute.expression.language.evaluation.functions.JsonPathBaseEvaluator
compileJsonPathExpression, getDocumentContext, getJsonPath, getResultRepresentation, getSubjectEvaluator, isJsonScalar, validateAndEstablishJsonContext
Methods inherited from class org.apache.nifi.attribute.expression.language.evaluation.StringEvaluator
getEvaluationsRemaining, getResultType, getToken, setToken
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
valueEvaluator
-
-
Constructor Details
-
JsonPathUpdateEvaluator
-
-
Method Details
-
evaluate
-
updateAttribute
public com.jayway.jsonpath.DocumentContext updateAttribute(com.jayway.jsonpath.DocumentContext documentContext, com.jayway.jsonpath.JsonPath jsonPath, Object value) Update the attribute at the specified path. The subclasses will need to implement this method.- Parameters:
documentContext
- the document to be updatedjsonPath
- the path to updatevalue
- the value to be applied at the specified path- Returns:
- the updated DocumentContext
- Throws:
org.apache.commons.lang3.NotImplementedException
- if operation is not implemented
-