java.lang.constant.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.
Some constable types have a native representation in the constant pool:
String, Integer, Long, Float, Double, Class, MethodType, and MethodHandle.The types String, Integer, Long, Float, and Double serve as their own nominal descriptors; Class, MethodType, and MethodHandle have the corresponding nominal descriptors ClassDesc, MethodTypeDesc, and MethodHandleDesc.
Declaration
public interface Constable {Optional<? extends ConstantDesc> describeConstable();}
Methods
1. describeConstable()
Optional<? extends ConstantDesc> java.lang.constant.Constable.describeConstable()
This method returns an Optional containing the nominal descriptor for this instance, if one can be constructed, or an empty Optional if one cannot be constructed.
Parameters: NA
Returns: An Optional containing the resulting nominal descriptor, or an empty Optional if one cannot be constructed.
Exceptions: NA
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