< prev index next >
src/java.base/share/classes/java/lang/constant/package-info.java
Print this page
rev 52981 : 8215300: additional changes to constants API
*** 47,57 ****
* value. Such a description is the <em>nominal form</em> of the constant value;
* it is not the value itself, but rather a "recipe" for describing the value,
* storing the value in a constant pool entry, or reconstituting the value given
* a class loading context. Every {@link java.lang.constant.ConstantDesc}
* knows how to <em>resolve</em> itself -- compute the value that it describes --
! * via {@link java.lang.constant.ConstantDesc#resolveConstantDesc(java.lang.invoke.MethodHandles.Lookup)}.
* This allows an API which accepts {@link java.lang.constant.ConstantDesc}
* objects to evaluate them reflectively, provided that the classes and methods
* referenced in their nominal description are present and accessible.
*
* <p>The subtypes of {@link java.lang.constant.ConstantDesc} describe various kinds
--- 47,57 ----
* value. Such a description is the <em>nominal form</em> of the constant value;
* it is not the value itself, but rather a "recipe" for describing the value,
* storing the value in a constant pool entry, or reconstituting the value given
* a class loading context. Every {@link java.lang.constant.ConstantDesc}
* knows how to <em>resolve</em> itself -- compute the value that it describes --
! * via {@link java.lang.constant.ConstantDesc#resolveConstantDesc(java.lang.invoke.MethodHandles.Lookup) ConstantDesc.resolveConstantDesc}.
* This allows an API which accepts {@link java.lang.constant.ConstantDesc}
* objects to evaluate them reflectively, provided that the classes and methods
* referenced in their nominal description are present and accessible.
*
* <p>The subtypes of {@link java.lang.constant.ConstantDesc} describe various kinds
*** 66,76 ****
* it should examine it to see which of these types it is, cast it, extract
* its nominal information, and generate the corresponding entry to the constant pool.
* When a bytecode-reading API encounters a constant pool entry, it can
* convert it to the appropriate type of nominal descriptor. For dynamic
* constants, bytecode-reading APIs may wish to use the factory
! * {@link java.lang.constant.DynamicConstantDesc#ofCanonical(DirectMethodHandleDesc, java.lang.String, ClassDesc, ConstantDesc[])},
* which will inspect the bootstrap and, for well-known bootstraps, return
* a more specific subtype of {@link java.lang.constant.DynamicConstantDesc}, such as
* {@link java.lang.Enum.EnumDesc}.
*
* <p>Another way to obtain the nominal description of a value is to ask the value
--- 66,76 ----
* it should examine it to see which of these types it is, cast it, extract
* its nominal information, and generate the corresponding entry to the constant pool.
* When a bytecode-reading API encounters a constant pool entry, it can
* convert it to the appropriate type of nominal descriptor. For dynamic
* constants, bytecode-reading APIs may wish to use the factory
! * {@link java.lang.constant.DynamicConstantDesc#ofCanonical(DirectMethodHandleDesc, java.lang.String, ClassDesc, ConstantDesc[]) DynamicConstantDesc.ofCanonical},
* which will inspect the bootstrap and, for well-known bootstraps, return
* a more specific subtype of {@link java.lang.constant.DynamicConstantDesc}, such as
* {@link java.lang.Enum.EnumDesc}.
*
* <p>Another way to obtain the nominal description of a value is to ask the value
< prev index next >