Package ai.mindconnect.workflow.jackson
Class JsonExpressionResolver
java.lang.Object
ai.mindconnect.workflow.jackson.JsonExpressionResolver
- All Implemented Interfaces:
ExpressionResolver
An
ExpressionResolver that parses a JSON string literal.
Expressions are recognised by the json: prefix:
json: {"name":"David","age":40} → LinkedHashMap
json: [1, 2, 3] → ArrayList
json: "hello" → String
json: 42 → Integer / Long
json: true → Boolean
This is useful for supplying structured objects as workflow input
parameters from the UI or command-line without needing a scripting engine.
For example, passing an input parameter value of
json: {"items":["a","b"]} will parse and inject the map directly
into the workflow variable scope.
Variable substitution (${var}) is applied to the JSON string
before parsing so dynamic values can be embedded:
json: {"user":"${username}"}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsExpression(Object value) eval(VariableScope variableScope, String expressionString) extractExpression(String expression)
-
Constructor Details
-
JsonExpressionResolver
public JsonExpressionResolver(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
containsExpression
- Specified by:
containsExpressionin interfaceExpressionResolver
-
extractExpression
- Specified by:
extractExpressionin interfaceExpressionResolver
-
eval
- Specified by:
evalin interfaceExpressionResolver
-