类 ConstantDynamic
- java.lang.Object
- org.springframework.asm.ConstantDynamic
public final class ConstantDynamic extends Object
A constant whose value is computed at runtime, with a bootstrap method.- 作者:
- Remi Forax
构造器概要
构造器 构造器 说明 ConstantDynamic(String name, String descriptor, Handle bootstrapMethod, Object... bootstrapMethodArguments)
Constructs a newConstantDynamic
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(Object object)
Handle
getBootstrapMethod()
Returns the bootstrap method used to compute the value of this constant.Object
getBootstrapMethodArgument(int index)
Returns an argument passed to the bootstrap method, in order to compute the value of this constant.int
getBootstrapMethodArgumentCount()
Returns the number of arguments passed to the bootstrap method, in order to compute the value of this constant.String
getDescriptor()
Returns the type of this constant.String
getName()
Returns the name of this constant.int
getSize()
Returns the size of this constant.int
hashCode()
String
toString()
构造器详细资料
ConstantDynamic
public ConstantDynamic(String name, String descriptor, Handle bootstrapMethod, Object... bootstrapMethodArguments)
Constructs a newConstantDynamic
.- 参数:
name
- the constant name (can be arbitrary).descriptor
- the constant type (must be a field descriptor).bootstrapMethod
- the bootstrap method to use to compute the constant value at runtime.bootstrapMethodArguments
- the arguments to pass to the bootstrap method, in order to compute the constant value at runtime.
方法详细资料
getDescriptor
public String getDescriptor()
Returns the type of this constant.- 返回:
- the type of this constant, as a field descriptor.
getBootstrapMethod
public Handle getBootstrapMethod()
Returns the bootstrap method used to compute the value of this constant.- 返回:
- the bootstrap method used to compute the value of this constant.
getBootstrapMethodArgumentCount
public int getBootstrapMethodArgumentCount()
Returns the number of arguments passed to the bootstrap method, in order to compute the value of this constant.- 返回:
- the number of arguments passed to the bootstrap method, in order to compute the value of this constant.
getBootstrapMethodArgument
public Object getBootstrapMethodArgument(int index)
Returns an argument passed to the bootstrap method, in order to compute the value of this constant.- 参数:
index
- an argument index, between 0 andgetBootstrapMethodArgumentCount()
(exclusive).- 返回:
- the argument passed to the bootstrap method, with the given index.
getSize
public int getSize()
Returns the size of this constant.- 返回:
- the size of this constant, i.e., 2 for
long
anddouble
, 1 otherwise.