Class ExpressionTransformationContextSupport<T extends ExpressionNode>

java.lang.Object
org.springframework.data.mongodb.core.spel.ExpressionTransformationContextSupport<T>

public class ExpressionTransformationContextSupport<T extends ExpressionNode> extends Object
The context for an ExpressionNode transformation.
Author:
Thomas Darimont, Oliver Gierke, Christoph Strobl, Mark Paluch
  • Constructor Details

  • Method Details

    • getCurrentNode

      public T getCurrentNode()
      Returns the current ExpressionNode.
      Returns:
    • getParentNode

      @Nullable public ExpressionNode getParentNode()
      Returns the parent ExpressionNode or null if none available.
      Returns:
    • getPreviousOperationObject

      @Nullable public org.bson.Document getPreviousOperationObject()
      Returns the previously accumulated operation object or null if none available. Rather than manually adding stuff to the object prefer using addToPreviousOrReturn(Object) to transparently do if one is present.
      Returns:
      See Also:
    • hasPreviousOperation

      public boolean hasPreviousOperation()
      Returns whether a previous operation is present.
      Returns:
    • parentIsSameOperation

      public boolean parentIsSameOperation()
      Returns whether the parent node is of the same operation as the current node.
      Returns:
    • addToPreviousOperation

      public org.bson.Document addToPreviousOperation(Object value)
      Adds the given value to the previous operation and returns it.
      Parameters:
      value -
      Returns:
    • addToPreviousOrReturn

      public Object addToPreviousOrReturn(Object value)
      Adds the given value to the previous operation if one is present or returns the value to add as is.
      Parameters:
      value -
      Returns: