spring-framework / org.springframework.expression.spel.ast / OpMultiply

OpMultiply

open class OpMultiply : Operator

Implements the multiply operator.

Conversions and promotions are handled as defined in Section 5.6.2 of the Java Language Specification, with the addiction of BigDecimal/BigInteger management:

If any of the operands is of a reference type, unboxing conversion (Section 5.1.8) is performed. Then: If either operand is of type BigDecimal, the other is converted to BigDecimal. If either operand is of type double, the other is converted to double. Otherwise, if either operand is of type float, the other is converted to float. If either operand is of type BigInteger, the other is converted to BigInteger. Otherwise, if either operand is of type long, the other is converted to long. Otherwise, both operands are converted to type int.

Author
Andy Clement

Author
Juergen Hoeller

Author
Sam Brannen

Author
Giovanni Dall'Oglio Risso

Since
3.0

Constructors

<init>

OpMultiply(pos: Int, vararg operands: SpelNodeImpl)

Functions

generateCode

open fun generateCode(mv: MethodVisitor, cf: CodeFlow): Unit

getValueInternal

open fun getValueInternal(state: ExpressionState): TypedValue

Implements the multiply operator directly here for certain types of supported operands and otherwise delegates to any registered overloader for types not supported here.

Supported operand types:

  • numbers
  • String and int ('abc' * 2 == 'abcabc')

isCompilable

open fun isCompilable(): Boolean