org.springframework.expression.spel.ast

Class Operator

    • Field Detail

      • leftActualDescriptor

        @Nullable
        protected java.lang.String leftActualDescriptor
      • rightActualDescriptor

        @Nullable
        protected java.lang.String rightActualDescriptor
    • Constructor Detail

      • Operator

        public Operator(java.lang.String payload,
                        int pos,
                        SpelNodeImpl... operands)
    • Method Detail

      • getOperatorName

        public final java.lang.String getOperatorName()
      • toStringAST

        public java.lang.String toStringAST()
        String format for all operators is the same '(' [operand] [operator] [operand] ')'.
        Returns:
        the string form
      • isCompilableOperatorUsingNumerics

        protected boolean isCompilableOperatorUsingNumerics()
      • generateComparisonCode

        protected void generateComparisonCode(MethodVisitor mv,
                                              CodeFlow cf,
                                              int compInstruction1,
                                              int compInstruction2)
        Numeric comparison operators share very similar generated code, only differing in two comparison instructions.
      • equalityCheck

        public static boolean equalityCheck(EvaluationContext context,
                                            @Nullable
                                            java.lang.Object left,
                                            @Nullable
                                            java.lang.Object right)
        Perform an equality check for the given operand values.

        This method is not just used for reflective comparisons in subclasses but also from compiled expression code, which is why it needs to be declared as public static here.

        Parameters:
        context - the current evaluation context
        left - the left-hand operand value
        right - the right-hand operand value