Spring Data MongoDB - Core

org.springframework.data.mongodb.core.spel
Class ExpressionTransformationContextSupport<T extends ExpressionNode>

java.lang.Object
  extended by 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

Constructor Summary
ExpressionTransformationContextSupport(T currentNode, ExpressionNode parentNode, com.mongodb.DBObject previousOperationObject)
          Creates a new ExpressionTransformationContextSupport for the given ExpressionNodes and an optional previous operation.
 
Method Summary
 com.mongodb.DBObject addToPreviousOperation(Object value)
          Adds the given value to the previous operation and returns it.
 Object addToPreviousOrReturn(Object value)
          Adds the given value to the previous operation if one is present or returns the value to add as is.
 T getCurrentNode()
          Returns the current ExpressionNode.
 ExpressionNode getParentNode()
          Returns the parent ExpressionNode or null if none available.
 com.mongodb.DBObject getPreviousOperationObject()
          Returns the previously accumulated operaton object or null if none available.
 boolean hasPreviousOperation()
          Returns whether a previous operation is present.
 boolean parentIsSameOperation()
          Returns whether the parent node is of the same operation as the current node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionTransformationContextSupport

public ExpressionTransformationContextSupport(T currentNode,
                                              ExpressionNode parentNode,
                                              com.mongodb.DBObject previousOperationObject)
Creates a new ExpressionTransformationContextSupport for the given ExpressionNodes and an optional previous operation.

Parameters:
currentNode - must not be null.
parentNode -
previousOperationObject -
Method Detail

getCurrentNode

public T getCurrentNode()
Returns the current ExpressionNode.

Returns:

getParentNode

public ExpressionNode getParentNode()
Returns the parent ExpressionNode or null if none available.

Returns:

getPreviousOperationObject

public com.mongodb.DBObject getPreviousOperationObject()
Returns the previously accumulated operaton 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(), addToPreviousOrReturn(Object)

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 com.mongodb.DBObject 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:

Spring Data MongoDB - Core

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.