< prev index next >
src/java.base/share/classes/java/lang/constant/ClassDesc.java
Print this page
rev 52981 : 8215300: additional changes to constants API
*** 110,126 ****
*
* @apiNote
*
* A field type descriptor string for a non-array type is either
* a one-letter code corresponding to a primitive type
! * ({@code J,I,C,S,B,D,F,Z,V}), or the letter {@code L}, followed
! * by the fully qualified binary name of a class, followed by {@code ;}.
! * A field type descriptor for an array type is the character {@code [}
* followed by the field descriptor for the component type. Examples of
! * valid type descriptor strings include {@code Ljava/lang/String;}, {@code I},
! * {@code [I}, {@code V}, {@code [Ljava/lang/String;}, etc.
! * for more detail.
*
* @param descriptor a field descriptor string
* @return a {@linkplain ClassDesc} describing the desired class
* @throws NullPointerException if any argument is {@code null}
* @throws IllegalArgumentException if the name string is not in the
--- 110,126 ----
*
* @apiNote
*
* A field type descriptor string for a non-array type is either
* a one-letter code corresponding to a primitive type
! * ({@code "J", "I", "C", "S", "B", "D", "F", "Z", "V"}), or the letter {@code "L"}, followed
! * by the fully qualified binary name of a class, followed by {@code ";"}.
! * A field type descriptor for an array type is the character {@code "["}
* followed by the field descriptor for the component type. Examples of
! * valid type descriptor strings include {@code "Ljava/lang/String;"}, {@code "I"},
! * {@code "[I"}, {@code "V"}, {@code "[Ljava/lang/String;"}, etc.
! * See JVMS 4.3.2 ("Field Descriptors") for more detail.
*
* @param descriptor a field descriptor string
* @return a {@linkplain ClassDesc} describing the desired class
* @throws NullPointerException if any argument is {@code null}
* @throws IllegalArgumentException if the name string is not in the
*** 160,169 ****
--- 160,175 ----
/**
* Returns a {@linkplain ClassDesc} for a nested class of the class or
* interface type described by this {@linkplain ClassDesc}.
*
+ * @apiNote
+ *
+ * Example: If descriptor {@code d} describes the class {@code java.util.Map}, a
+ * descriptor for the class {@code java.util.Map.Entry} could be obtained
+ * by {@code d.nested("Entry")}.
+ *
* @param nestedName the unqualified name of the nested class
* @return a {@linkplain ClassDesc} describing the nested class
* @throws NullPointerException if any argument is {@code null}
* @throws IllegalStateException if this {@linkplain ClassDesc} does not
* describe a class or interface type
< prev index next >