public class Constant
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.util.function.Consumer<MethodWriter> |
initializer |
Location |
location |
java.lang.String |
name |
org.objectweb.asm.Type |
type |
| Constructor and Description |
|---|
Constant(Location location,
org.objectweb.asm.Type type,
java.lang.String name,
java.util.function.Consumer<MethodWriter> initializer)
Create a new constant.
|
public final Location location
public final java.lang.String name
public final org.objectweb.asm.Type type
public final java.util.function.Consumer<MethodWriter> initializer
public Constant(Location location, org.objectweb.asm.Type type, java.lang.String name, java.util.function.Consumer<MethodWriter> initializer)
location - the location in the script that is creating ittype - the type of the constantname - the name of the constantinitializer - code to initialize the constant. It will be called when generating the clinit method and is expected to leave the
value of the constant on the stack. Generating the load instruction is managed by the caller.