类 OpMinus

所有已实现的接口:
Opcodes, SpelNode

public class OpMinus extends Operator
The minus operator supports:
  • subtraction of numbers
  • 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. The standard promotions are performed when the operand types vary (double-int=double). For other options it defers to the registered overloader.

从以下版本开始:
4.0
作者:
Andy Clement, Juergen Hoeller, Giovanni Dall'Oglio Risso, Sam Brannen, Harry Yang
  • 构造器详细资料

    • OpMinus

      public OpMinus(int startPos, int endPos, SpelNodeImpl... operands)
  • 方法详细资料

    • isNegativeNumberLiteral

      public boolean isNegativeNumberLiteral()
      Determine if this operator is a unary minus and its child is a number literal.
      返回:
      true if it is a negative number literal
    • getValueInternal

      public TypedValue getValueInternal(ExpressionState state) throws EvaluationException
      指定者:
      getValueInternal 在类中 SpelNodeImpl
      抛出:
      EvaluationException
    • toStringAST

      public String toStringAST()
      从类复制的说明: Operator
      String format for all operators is the same '(' [operand] [operator] [operand] ')'.
      指定者:
      toStringAST 在接口中 SpelNode
      覆盖:
      toStringAST 在类中 Operator
      返回:
      the string form
    • getRightOperand

      public SpelNodeImpl getRightOperand()
      覆盖:
      getRightOperand 在类中 Operator
    • isCompilable

      public boolean isCompilable()
      从类复制的说明: SpelNodeImpl
      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.
      覆盖:
      isCompilable 在类中 SpelNodeImpl
      返回:
      true if this node can be compiled to bytecode
    • generateCode

      public void generateCode(MethodVisitor mv, CodeFlow cf)
      从类复制的说明: SpelNodeImpl
      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.
      覆盖:
      generateCode 在类中 SpelNodeImpl
      参数:
      mv - the ASM MethodVisitor into which code should be generated
      cf - a context object with info about what is on the stack