# Uses of Interface
java.lang.constant.ConstantDesc

Packages that use ConstantDesc
Package
Description
java.lang
Provides classes that are fundamental to the design of the Java programming language.
java.lang.classfile
Provides classfile parsing, generation, and transformation library.
java.lang.classfile.attribute
Provides interfaces describing `class` file attributes for the `java.lang.classfile` library.
java.lang.classfile.constantpool
Provides interfaces describing constant pool entries for the `java.lang.classfile` library.
java.lang.classfile.instruction
Provides interfaces describing code instructions for the `java.lang.classfile` library.
java.lang.constant
Classes and interfaces to represent nominal descriptors for run-time entities such as classes or method handles, and classfile entities such as constant pool entries or `invokedynamic` call sites.
java.lang.invoke
The `java.lang.invoke` package provides low-level primitives for interacting with the Java Virtual Machine.

- ## Uses of ConstantDesc in java.lang

  Classes in java.lang that implement ConstantDesc
  Modifier and Type
  Class
  Description
  `final class`
  `Double`
  The `Double` class is the wrapper class for values of the primitive type `double`.
  `static final class`
  `Enum.EnumDesc<E extends Enum<E>>`
  A nominal descriptor for an `enum` constant.
  `final class`
  `Float`
  The `Float` class is the wrapper class for values of the primitive type `float`.
  `final class`
  `Integer`
  The `Integer` class is the wrapper class for values of the primitive type `int`.
  `final class`
  `Long`
  The `Long` class is the wrapper class for values of the primitive type `long`.
  `final class`
  `String`
  The `String` class represents character strings.

- ## Uses of ConstantDesc in java.lang.classfile

  Methods in java.lang.classfile with parameters of type ConstantDesc
  Modifier and Type
  Method
  Description
  `default CodeBuilder`
  CodeBuilder.`ldc(ConstantDesc value)`
  Generates an instruction pushing an item from the run-time constant pool onto the operand stack.
  `default CodeBuilder`
  CodeBuilder.`loadConstant(ConstantDesc value)`
  Generates an instruction pushing a constant onto the operand stack.

- ## Uses of ConstantDesc in java.lang.classfile.attribute

  Methods in java.lang.classfile.attribute with parameters of type ConstantDesc
  Modifier and Type
  Method
  Description
  `static ConstantValueAttribute`
  ConstantValueAttribute.`of(ConstantDesc value)`
  Returns a `ConstantValue` attribute.

- ## Uses of ConstantDesc in java.lang.classfile.constantpool

  Methods in java.lang.classfile.constantpool that return ConstantDesc
  Modifier and Type
  Method
  Description
  `ConstantDesc`
  AnnotationConstantValueEntry.`constantValue()`
  Returns the constant value.
  `default ConstantDesc`
  ClassEntry.`constantValue()`
  Returns a symbolic descriptor of this constant.
  `default ConstantDesc`
  ConstantDynamicEntry.`constantValue()`
  Returns a symbolic descriptor of this constant.
  `ConstantDesc`
  ConstantValueEntry.`constantValue()`
  Returns the constant value.
  `ConstantDesc`
  LoadableConstantEntry.`constantValue()`
  Returns a symbolic descriptor of this constant.
  `default ConstantDesc`
  MethodHandleEntry.`constantValue()`
  Returns a symbolic descriptor of this constant.
  `default ConstantDesc`
  MethodTypeEntry.`constantValue()`
  Returns a symbolic descriptor of this constant.
  Methods in java.lang.classfile.constantpool with parameters of type ConstantDesc
  Modifier and Type
  Method
  Description
  `default ConstantValueEntry`
  ConstantPoolBuilder.`constantValueEntry(ConstantDesc c)`
  Returns a `ConstantValueEntry` describing the provided constant `Integer`, `Long`, `Float`, `Double`, or `String` value.
  `default LoadableConstantEntry`
  ConstantPoolBuilder.`loadableConstantEntry(ConstantDesc c)`
  Returns a `LoadableConstantEntry` describing the provided constant value.
  Method parameters in java.lang.classfile.constantpool with type arguments of type ConstantDesc
  Modifier and Type
  Method
  Description
  `default BootstrapMethodEntry`
  ConstantPoolBuilder.`bsmEntry(DirectMethodHandleDesc methodReference, List<ConstantDesc> arguments)`
  Returns a `BootstrapMethodEntry` describing the provided bootstrap method and arguments.

- ## Uses of ConstantDesc in java.lang.classfile.instruction

  Methods in java.lang.classfile.instruction that return ConstantDesc
  Modifier and Type
  Method
  Description
  `ConstantDesc`
  ConstantInstruction.`constantValue()`
  Returns the constant value.
  Methods in java.lang.classfile.instruction that return types with arguments of type ConstantDesc
  Modifier and Type
  Method
  Description
  `default List<ConstantDesc>`
  InvokeDynamicInstruction.`bootstrapArgs()`
  Returns the bootstrap arguments of the call site.

- ## Uses of ConstantDesc in java.lang.constant

  Subinterfaces of ConstantDesc in java.lang.constant
  Modifier and Type
  Interface
  Description
  `interface`
  `ClassDesc`
  A nominal descriptor for a `Class` constant.
  `interface`
  `DirectMethodHandleDesc`
  A nominal descriptor for a direct `MethodHandle`.
  `interface`
  `MethodHandleDesc`
  A nominal descriptor for a `MethodHandle` constant.
  `interface`
  `MethodTypeDesc`
  A nominal descriptor for a MethodType constant.
  Classes in java.lang.constant that implement ConstantDesc
  Modifier and Type
  Class
  Description
  `class`
  `DynamicConstantDesc<T>`
  A nominal descriptor for a dynamic constant (one described in the constant pool with `Constant_Dynamic_info`.)
  Fields in java.lang.constant declared as ConstantDesc
  Modifier and Type
  Field
  Description
  `static final ConstantDesc`
  ConstantDescs.`NULL`
  Nominal descriptor representing the constant `null`
  Methods in java.lang.constant that return ConstantDesc
  Modifier and Type
  Method
  Description
  `ConstantDesc[]`
  DynamicCallSiteDesc.`bootstrapArgs()`
  Returns `ConstantDesc`s describing the bootstrap arguments for the `invokedynamic`.
  `ConstantDesc[]`
  DynamicConstantDesc.`bootstrapArgs()`
  Returns the bootstrap arguments for this constant.
  `static <T> ConstantDesc`
  DynamicConstantDesc.`ofCanonical(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc[] bootstrapArgs)`
  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.
  Methods in java.lang.constant that return types with arguments of type ConstantDesc
  Modifier and Type
  Method
  Description
  `List<ConstantDesc>`
  DynamicConstantDesc.`bootstrapArgsList()`
  Returns the bootstrap arguments for this constant as an immutable `List`.
  `Optional<? extends ConstantDesc>`
  Constable.`describeConstable()`
  Returns an `Optional` containing the nominal descriptor for this instance, if one can be constructed, or an empty `Optional` if one cannot be constructed.
  Methods in java.lang.constant with parameters of type ConstantDesc
  Modifier and Type
  Method
  Description
  `static DynamicCallSiteDesc`
  DynamicCallSiteDesc.`of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs)`
  Creates a nominal descriptor for an `invokedynamic` call site.
  `static <T> DynamicConstantDesc<T>`
  DynamicConstantDesc.`of(DirectMethodHandleDesc bootstrapMethod, ConstantDesc... bootstrapArgs)`
  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.
  `static <T> ConstantDesc`
  DynamicConstantDesc.`ofCanonical(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc[] bootstrapArgs)`
  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.
  `static <T> DynamicConstantDesc<T>`
  DynamicConstantDesc.`ofNamed(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs)`
  Returns a nominal descriptor for a dynamic constant.
  `DynamicCallSiteDesc`
  DynamicCallSiteDesc.`withArgs(ConstantDesc... bootstrapArgs)`
  Returns a nominal descriptor for an `invokedynamic` call site whose bootstrap method, name, and invocation type are the same as this one, but with the specified bootstrap arguments.
  Constructors in java.lang.constant with parameters of type ConstantDesc
  Modifier
  Constructor
  Description
  `protected`
  `DynamicConstantDesc(DirectMethodHandleDesc bootstrapMethod, String constantName, ClassDesc constantType, ConstantDesc... bootstrapArgs)`
  Creates a nominal descriptor for a dynamic constant.

- ## Uses of ConstantDesc in java.lang.invoke

  Classes in java.lang.invoke that implement ConstantDesc
  Modifier and Type
  Class
  Description
  `static final class`
  `VarHandle.VarHandleDesc`
  A nominal descriptor for a `VarHandle` constant.