org.springframework.expression.spel.ast
Class OpMinus
java.lang.Object
org.springframework.expression.spel.ast.SpelNodeImpl
org.springframework.expression.spel.ast.Operator
org.springframework.expression.spel.ast.OpMinus
- All Implemented Interfaces:
- SpelNode
public class OpMinus
- extends Operator
The minus operator supports:
- subtraction of doubles (floats are represented as doubles)
- subtraction of longs
- subtraction of integers
- subtraction of an int from a string of one character (effectively decreasing that character), so 'd'-3='a'
It can be used as a unary operator for numbers (double/long/int). The standard promotions are performed
when the operand types vary (double-int=double).
For other options it defers to the registered overloader.
- Since:
- 3.0
- Author:
- Andy Clement
Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl |
getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, isWritable, nextChildIs, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OpMinus
public OpMinus(int pos,
SpelNodeImpl... operands)
getValueInternal
public TypedValue getValueInternal(ExpressionState state)
throws EvaluationException
- Specified by:
getValueInternal
in class SpelNodeImpl
- Throws:
EvaluationException
toStringAST
public String toStringAST()
- Description copied from class:
Operator
- String format for all operators is the same '(' [operand] [operator] [operand] ')'
- Specified by:
toStringAST
in interface SpelNode
- Overrides:
toStringAST
in class Operator
- Returns:
- the string form of this AST node
getRightOperand
public SpelNodeImpl getRightOperand()
- Overrides:
getRightOperand
in class Operator