Class ExpressionTransformationContextSupport<T extends ExpressionNode>
java.lang.Object
org.springframework.data.mongodb.core.spel.ExpressionTransformationContextSupport<T>
The context for an
ExpressionNode
transformation.- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionExpressionTransformationContextSupport
(T currentNode, ExpressionNode parentNode, org.bson.Document previousOperationObject) Creates a newExpressionTransformationContextSupport
for the givenExpressionNode
s and an optional previous operation. -
Method Summary
Modifier and TypeMethodDescriptionorg.bson.Document
addToPreviousOperation
(Object value) Adds the given value to the previous operation and returns it.addToPreviousOrReturn
(Object value) Adds the given value to the previous operation if one is present or returns the value to add as is.Returns the currentExpressionNode
.Returns the parentExpressionNode
or null if none available.org.bson.Document
Returns the previously accumulated operation object or null if none available.boolean
Returns whether a previous operation is present.boolean
Returns whether the parent node is of the same operation as the current node.
-
Constructor Details
-
ExpressionTransformationContextSupport
public ExpressionTransformationContextSupport(T currentNode, @Nullable ExpressionNode parentNode, @Nullable org.bson.Document previousOperationObject) Creates a newExpressionTransformationContextSupport
for the givenExpressionNode
s and an optional previous operation.- Parameters:
currentNode
- must not be null.parentNode
- may be null.previousOperationObject
- may be null.
-
-
Method Details
-
getCurrentNode
Returns the currentExpressionNode
.- Returns:
-
getParentNode
Returns the parentExpressionNode
or null if none available.- Returns:
-
getPreviousOperationObject
Returns the previously accumulated operation object or null if none available. Rather than manually adding stuff to the object prefer usingaddToPreviousOrReturn(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
Adds the given value to the previous operation and returns it.- Parameters:
value
-- Returns:
-
addToPreviousOrReturn
Adds the given value to the previous operation if one is present or returns the value to add as is.- Parameters:
value
-- Returns:
-