类 ConstantDynamic
java.lang.Object
cn.taketoday.bytecode.ConstantDynamic
A constant whose value is computed at runtime, with a bootstrap method.
- 作者:
- Remi Forax
-
字段概要
字段修饰符和类型字段说明private final HandleThe bootstrap method to use to compute the constant value at runtime.private final Object[]The arguments to pass to the bootstrap method, in order to compute the constant value at runtime.private final StringThe constant type (must be a field descriptor).private final StringThe constant name (can be arbitrary). -
构造器概要
构造器构造器说明ConstantDynamic(String name, String descriptor, Handle bootstrapMethod, Object... bootstrapMethodArguments) Constructs a newConstantDynamic. -
方法概要
修饰符和类型方法说明booleanReturns the bootstrap method used to compute the value of this constant.getBootstrapMethodArgument(int index) Returns an argument passed to the bootstrap method, in order to compute the value of this constant.intReturns the number of arguments passed to the bootstrap method, in order to compute the value of this constant.(专用程序包) Object[]Returns the arguments to pass to the bootstrap method, in order to compute the value of this constant.Returns the type of this constant.getName()Returns the name of this constant.intgetSize()Returns the size of this constant.inthashCode()toString()
-
字段详细资料
-
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.
-
-
构造器详细资料
-
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.
-
-
方法详细资料
-
getName
Returns the name of this constant.- 返回:
- the name of this constant.
-
getDescriptor
Returns the type of this constant.- 返回:
- the type of this constant, as a field descriptor.
-
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
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.
-
getBootstrapMethodArgumentsUnsafe
Object[] getBootstrapMethodArgumentsUnsafe()Returns the arguments to pass to the bootstrap method, in order to compute the value of this constant. WARNING: this array must not be modified, and must not be returned to the user.- 返回:
- the arguments to pass to the bootstrap method, in order to compute the value of this constant.
-
getSize
public int getSize()Returns the size of this constant.- 返回:
- the size of this constant, i.e., 2 for
longanddouble, 1 otherwise.
-
equals
-
hashCode
public int hashCode() -
toString
-