Class ExpressionNode
java.lang.Object
org.springframework.data.mongodb.core.spel.ExpressionNode
- All Implemented Interfaces:
Iterable<ExpressionNode>
- Direct Known Subclasses:
LiteralNode
,MethodReferenceNode
,NotOperatorNode
,OperatorNode
A value object for nodes in an expression. Allows iterating ove potentially available child
ExpressionNode
s.- Author:
- Oliver Gierke, Christoph Strobl, Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ExpressionNode
Creates a newExpressionNode
from the givenSpelNode
.static ExpressionNode
from
(SpelNode node, ExpressionState state) getChild
(int index) Returns the childExpressionNode
with the given index.getName()
Returns the name of theExpressionNode
.getValue()
Returns the value of the current node.boolean
Returns whether the current node has child nodes.boolean
hasfirstChildNotOfType
(Class<?> type) Returns whether theExpressionNode
has a first child node that is not of the given type.boolean
Returns whether theExpressionNode
is a literal.boolean
Returns whether theExpressionNode
is a logical conjunction operation like&&, ||
.boolean
Returns whether theExpressionNode
is a mathematical operation.boolean
Returns whether the currentExpressionNode
is backed by the given type.iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ExpressionNode
- Parameters:
node
- must not be null.state
- must not be null.
-
-
Method Details
-
from
- Parameters:
node
-state
- must not be null.- Returns:
- an
ExpressionNode
for the givenSpelNode
or null if null was given for theSpelNode
.
-
getName
Returns the name of theExpressionNode
.- Returns:
-
isOfType
Returns whether the currentExpressionNode
is backed by the given type.- Parameters:
type
- must not be null.- Returns:
-
isMathematicalOperation
public boolean isMathematicalOperation()Returns whether theExpressionNode
is a mathematical operation.- Returns:
-
isLogicalOperator
public boolean isLogicalOperator()Returns whether theExpressionNode
is a logical conjunction operation like&&, ||
.- Returns:
- Since:
- 1.10
-
isLiteral
public boolean isLiteral()Returns whether theExpressionNode
is a literal.- Returns:
-
getValue
Returns the value of the current node.- Returns:
-
hasChildren
public boolean hasChildren()Returns whether the current node has child nodes.- Returns:
-
getChild
Returns the childExpressionNode
with the given index.- Parameters:
index
- must not be negative.- Returns:
-
hasfirstChildNotOfType
Returns whether theExpressionNode
has a first child node that is not of the given type.- Parameters:
type
- must not be null.- Returns:
-
from
Creates a newExpressionNode
from the givenSpelNode
.- Parameters:
node
-- Returns:
-
iterator
- Specified by:
iterator
in interfaceIterable<ExpressionNode>
-