Top Description Fields Constructors Methods
org.springframework.expression.spel.ast

public Class OpMinus

extends Operator
Class Inheritance
Imports
java.math.BigDecimal, .BigInteger, org.springframework.asm.MethodVisitor, org.springframework.expression.EvaluationException, .Operation, .TypedValue, org.springframework.expression.spel.CodeFlow, .ExpressionState, org.springframework.util.Assert, .NumberUtils

The minus operator supports:

It can be used as a unary operator for numbers. The standard promotions are performed when the operand types vary (double-int=double). For other options it defers to the registered overloader.

Authors
Andy Clement, Juergen Hoeller, Giovanni Dall'Oglio Risso, Sam Brannen, Semyon Danilov
Since
3.0

Field Summary

Inherited from org.springframework.expression.spel.ast.Operator:
leftActualDescriptorrightActualDescriptor

Constructor Summary

AccessConstructor and Description
public
OpMinus(int startPos, int endPos, SpelNodeImpl... operands)

Method Summary

Modifier and TypeMethod and Description
public void
generateCode(MethodVisitor
the ASM MethodVisitor into which code should be generated
mv
,
CodeFlow
a context object with info about what is on the stack
cf
)

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.generateCode.

Generate the bytecode for this node into the supplied visitor.

public SpelNodeImpl
public TypedValue
public boolean
isCompilable()

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.isCompilable.

Check whether a node can be compiled to bytecode.

public boolean

Returns:

true if it is a negative number literal
isNegativeNumberLiteral
()

Determine if this operator is a unary minus and its child is a number literal.

public String
toStringAST()

Overrides org.springframework.expression.spel.ast.Operator.toStringAST.

Implements org.springframework.expression.spel.SpelNode.toStringAST.

String format for all operators is the same '(' [operand] [operator] [operand] ')'.

Inherited from org.springframework.expression.spel.ast.Operator:
equalityCheckgenerateComparisonCodegetLeftOperandgetOperatorNameisCompilableOperatorUsingNumerics

Constructor Detail

OpMinusback to summary
public OpMinus(int startPos, int endPos, SpelNodeImpl... operands)

Method Detail

generateCodeback to summary
public void generateCode(MethodVisitor mv, CodeFlow cf)

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.generateCode.

Doc from org.springframework.expression.spel.ast.SpelNodeImpl.generateCode.

Generate the bytecode for this node into the supplied visitor. Context info about the current expression being compiled is available in the codeflow object, e.g. including information about the type of the object currently on the stack.

Parameters
mv:MethodVisitor

the ASM MethodVisitor into which code should be generated

cf:CodeFlow

a context object with info about what is on the stack

Annotations
@Override
getRightOperandback to summary
public SpelNodeImpl getRightOperand()

Overrides org.springframework.expression.spel.ast.Operator.getRightOperand.

Annotations
@Override
getValueInternalback to summary
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException

Implements abstract org.springframework.expression.spel.ast.SpelNodeImpl.getValueInternal.

Annotations
@Override
isCompilableback to summary
public boolean isCompilable()

Overrides org.springframework.expression.spel.ast.SpelNodeImpl.isCompilable.

Doc from org.springframework.expression.spel.ast.SpelNodeImpl.isCompilable.

Check whether a node can be compiled to bytecode. The reasoning in each node may be different but will typically involve checking whether the exit type descriptor of the node is known and any relevant child nodes are compilable.

Returns:boolean

true if this node can be compiled to bytecode

Annotations
@Override
isNegativeNumberLiteralback to summary
public boolean isNegativeNumberLiteral()

Determine if this operator is a unary minus and its child is a number literal.

Returns:boolean

true if it is a negative number literal

Since
6.1
toStringASTback to summary
public String toStringAST()

Overrides org.springframework.expression.spel.ast.Operator.toStringAST.

Implements org.springframework.expression.spel.SpelNode.toStringAST.

Doc from org.springframework.expression.spel.ast.Operator.toStringAST.

String format for all operators is the same '(' [operand] [operator] [operand] ')'.

Returns:String

Doc from org.springframework.expression.spel.SpelNode.toStringAST.

the string form

Annotations
@Override