Class ParameterBindingContext

java.lang.Object
org.springframework.data.mongodb.util.json.ParameterBindingContext

public class ParameterBindingContext extends Object
Reusable context for binding parameters to a placeholder or a SpEL expression within a JSON structure.
To be used along with ParameterBindingDocumentCodec.decode(String, ParameterBindingContext).
Since:
2.2
Author:
Christoph Strobl, Mark Paluch
  • Constructor Details

    • ParameterBindingContext

      public ParameterBindingContext(ValueProvider valueProvider, org.springframework.expression.spel.standard.SpelExpressionParser expressionParser, org.springframework.expression.EvaluationContext evaluationContext)
      Parameters:
      valueProvider -
      expressionParser -
      evaluationContext -
    • ParameterBindingContext

      public ParameterBindingContext(ValueProvider valueProvider, org.springframework.expression.ExpressionParser expressionParser, Supplier<org.springframework.expression.EvaluationContext> evaluationContext)
      Parameters:
      valueProvider -
      expressionParser -
      evaluationContext - a Supplier for Lazy context retrieval.
      Since:
      2.2.3
    • ParameterBindingContext

      public ParameterBindingContext(ValueProvider valueProvider, org.springframework.data.mapping.model.SpELExpressionEvaluator expressionEvaluator)
      Parameters:
      valueProvider -
      expressionEvaluator -
      Since:
      3.1
  • Method Details

    • forExpressions

      public static ParameterBindingContext forExpressions(ValueProvider valueProvider, org.springframework.expression.ExpressionParser expressionParser, Function<org.springframework.data.spel.ExpressionDependencies,org.springframework.expression.EvaluationContext> contextFunction)
      Create a new ParameterBindingContext that is capable of expression parsing and can provide a EvaluationContext based on ExpressionDependencies.
      Parameters:
      valueProvider -
      expressionParser -
      contextFunction -
      Returns:
      Since:
      3.1
    • bindableValueForIndex

      @Nullable public Object bindableValueForIndex(int index)
    • evaluateExpression

      @Nullable public Object evaluateExpression(String expressionString)
    • evaluateExpression

      @Nullable public Object evaluateExpression(String expressionString, Map<String,Object> variables)
    • getValueProvider

      public ValueProvider getValueProvider()