java.lang.constant.DynamicConstantDesc<?>
A nominal descriptor for a dynamic constant.
Concrete subtypes of DynamicConstantDesc must be value-based.
Type Parameters: <T> the type of the dynamic constant.
Some methods of DynamicConstantDesc class
DynamicConstantDesc.ofNamed(DirectMethodHandleDesc, String, ClassDesc, ConstantDesc...): This method returns a nominal descriptor for a dynamic constant.
bootstrapArgs(): This method returns the bootstrap arguments for this constant.
bootstrapArgsList(): This method returns the bootstrap arguments for this constant as an immutable List.
bootstrapMethod(): This method returns a MethodHandleDesc describing the bootstrap method for this constant.
constantName(): This method returns the name that would appear in the NameAndType operand of the LDC for this constant.
constantType(): This method returns a ClassDesc describing the type that would appear in the NameAndType operand of the LDC for this constant.
equals(Object): This method compares the specified object with this descriptor for equality. Returns true if and only if the specified object is also a DynamicConstantDesc, and both descriptors have equal bootstrap methods, bootstrap argument lists, constant name, and constant type.
hashCode(): This method returns a hash code value for the object.
DynamicConstantDesc.of(DirectMethodHandleDesc): This method returns a nominal descriptor for a dynamic constant whose bootstrap has no static arguments, and whose name parameter is ConstantDescs.DEFAULT_NAME, and whose type parameter is always the same as the bootstrap method return type.
DynamicConstantDesc.of(DirectMethodHandleDesc, ConstantDesc...): This method returns a nominal descriptor for a dynamic constant whose name parameter is ConstantDescs.DEFAULT_NAME, and whose type parameter is always the same as the bootstrap method return type.
DynamicConstantDesc.ofCanonical(DirectMethodHandleDesc, String, ClassDesc, ConstantDesc[]): This method returns a nominal descriptor for a dynamic constant, transforming it into a more specific type if the constant bootstrap is a well-known one and a more specific nominal descriptor type (e.g., ClassDesc) is available.
resolveConstantDesc(Lookup): This method resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution and access control context is provided by MethodHandles.Lookupparameter. No caching of the resulting value is performed.
toString(): This method returns a compact textual description of this constant description, including the bootstrap method, the constant name and type, and the static bootstrap arguments.
Some other classes/interfaces of java.lang.constant
MethodTypeDesc: A nominal descriptor for a MethodType constant.
MethodHandleDesc: A nominal descriptor for a MethodHandle constant.
DynamicConstantDesc: A nominal descriptor for a dynamic constant.
DynamicCallSiteDesc: A nominal descriptor for an invoke dynamic call site.
DirectMethodHandleDesc: A nominal descriptor for a direct MethodHandle. A DirectMethodHandleDesc corresponds to a Constant_MethodHandle_info entry in the constant pool of a class file.
ConstantDescs: Predefined values of nominal descriptors for common constants, including descriptors for primitive class types and other common platform types, and descriptors for method handles for standard bootstrap methods.
ConstantDesc: A nominal descriptor for a loadable constant value. Such a descriptor can be resolved via ConstantDesc.resolveConstantDesc(MethodHandles.Lookup) to yield the constant value itself.
Constable: Represents a type that is constable. A constable type is one whose values are constants that can be represented in the constant pool of a Java class file.
ClassDesc: A nominal descriptor for a Class constant.
No comments:
Post a Comment