spring-framework / org.springframework.asm / ClassWriter / newConst

newConst

open fun newConst(cst: Any): Int

Adds a number or string constant to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.

Parameters

cst - the value of the constant to be added to the constant pool. This parameter must be an Integer, a Float, a Long, a Double or a String.

Return
the index of a new or already existing constant item with the given value.