Skip to content

Commit 822ac84

Browse files
committed
Use imports for classfile api intro
1 parent 08a6ee2 commit 822ac84

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

src/java.base/share/classes/java/lang/classfile/package-info.java

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,19 @@
105105
* pool</em>. {@link ClassModel} provides a lazily-inflated,
106106
* read-only view of the constant pool via {@link ClassModel#constantPool()}.
107107
* Descriptions of classfile content is often exposed in the form of various
108-
* subtypes of {@link java.lang.classfile.constantpool.PoolEntry}, such as {@link
109-
* java.lang.classfile.constantpool.ClassEntry} or {@link java.lang.classfile.constantpool.Utf8Entry}.
108+
* subtypes of {@link PoolEntry}, such as {@link
109+
* ClassEntry} or {@link Utf8Entry}.
110110
* <p>
111111
* Constant pool entries are also exposed through models and elements; in the
112-
* above traversal example, the {@link java.lang.classfile.instruction.InvokeInstruction}
112+
* above traversal example, the {@link InvokeInstruction}
113113
* element exposed a method for {@code owner} that corresponds to a {@code
114114
* Constant_Class_info} entry in the constant pool.
115115
*
116116
* <h3>Attributes</h3>
117117
* Much of the contents of a classfile is stored in attributes; attributes are
118118
* found on classes, methods, fields, record components, and on the {@code Code}
119119
* attribute. Most attributes are surfaced as elements; for example, {@link
120-
* java.lang.classfile.attribute.SignatureAttribute} is a {@link
120+
* SignatureAttribute} is a {@link
121121
* ClassElement}, {@link MethodElement}, and {@link
122122
* FieldElement} since it can appear in all of those places, and is
123123
* included when iterating the elements of the corresponding model.
@@ -139,9 +139,9 @@
139139
* Each standard attribute has an interface (in {@code java.lang.classfile.attribute})
140140
* which exposes the contents of the attribute and provides factories to
141141
* construct the attribute. For example, the {@code Signature} attribute is
142-
* defined by the {@link java.lang.classfile.attribute.SignatureAttribute} class, and
143-
* provides accessors for {@link java.lang.classfile.attribute.SignatureAttribute#signature()}
144-
* as well as factories taking {@link java.lang.classfile.constantpool.Utf8Entry} or
142+
* defined by the {@link SignatureAttribute} class, and
143+
* provides accessors for {@link SignatureAttribute#signature()}
144+
* as well as factories taking {@link Utf8Entry} or
145145
* {@link String}.
146146
*
147147
* <h3>Custom attributes</h3>
@@ -163,12 +163,12 @@
163163
* JDK such as {@code CharacterRangeTable}.
164164
* <p>
165165
* Unrecognized attributes are delivered as elements of type {@link
166-
* java.lang.classfile.attribute.UnknownAttribute}, which provide access only to the
166+
* UnknownAttribute}, which provide access only to the
167167
* {@code byte[]} contents of the attribute.
168168
* <p>
169169
* For nonstandard attributes, user-provided attribute mappers can be specified
170170
* through the use of the {@link
171-
* ClassFile.AttributeMapperOption#of(java.util.function.Function)}}
171+
* ClassFile.AttributeMapperOption#of(Function)}}
172172
* classfile option. Implementations of custom attributes should extend {@link
173173
* CustomAttribute}.
174174
*
@@ -179,7 +179,7 @@
179179
* for some statically enumerated options, as well as factories for more complex options,
180180
* including:
181181
* <ul>
182-
* <li>{@link ClassFile.AttributeMapperOption#of(java.util.function.Function)}
182+
* <li>{@link ClassFile.AttributeMapperOption#of(Function)}
183183
* -- specify format of custom attributes</li>
184184
* <li>{@link ClassFile.AttributesProcessingOption}
185185
* -- unrecognized or problematic original attributes (default is {@code PASS_ALL_ATTRIBUTES})</li>
@@ -231,10 +231,10 @@
231231
* Builders often support multiple ways of expressing the same entity at
232232
* different levels of abstraction. For example, the {@code invokevirtual}
233233
* instruction invoking {@code println} could have been generated with {@link
234-
* CodeBuilder#invokevirtual(java.lang.constant.ClassDesc,
235-
* String, java.lang.constant.MethodTypeDesc) CodeBuilder.invokevirtual}, {@link
234+
* CodeBuilder#invokevirtual(ClassDesc,
235+
* String, MethodTypeDesc) CodeBuilder.invokevirtual}, {@link
236236
* CodeBuilder#invoke(Opcode,
237-
* java.lang.constant.ClassDesc, String, java.lang.constant.MethodTypeDesc,
237+
* ClassDesc, String, MethodTypeDesc,
238238
* boolean) CodeBuilder.invoke}, or {@link
239239
* CodeBuilder#with(ClassFileElement)
240240
* CodeBuilder.with}.
@@ -252,13 +252,13 @@
252252
*
253253
* <h3>Symbolic information</h3>
254254
* To describe symbolic information for classes and types, the API uses the
255-
* nominal descriptor abstractions from {@code java.lang.constant} such as {@link
256-
* java.lang.constant.ClassDesc} and {@link java.lang.constant.MethodTypeDesc},
255+
* nominal descriptor abstractions from {@link java.lang.constant} such as {@link
256+
* ClassDesc} and {@link MethodTypeDesc},
257257
* which is less error-prone than using raw strings.
258258
* <p>
259259
* If a constant pool entry has a nominal representation then it provides a
260260
* method returning the corresponding nominal descriptor type e.g.
261-
* method {@link java.lang.classfile.constantpool.ClassEntry#asSymbol} returns
261+
* method {@link ClassEntry#asSymbol} returns
262262
* {@code ClassDesc}.
263263
* <p>
264264
* Where appropriate builders provide two methods for building an element with
@@ -278,7 +278,7 @@
278278
* ClassFile API library based on the actual context. Also these nominal
279279
* descriptors are validated during their construction, so it is not possible to
280280
* create them with invalid content by mistake. Following example pass class
281-
* name to the {@link java.lang.constant.ClassDesc#of} method for validation
281+
* name to the {@link ClassDesc#of} method for validation
282282
* and the library performs automatic conversion to the right internal form of
283283
* the class name when serialized in the constant pool as a class entry.
284284
* {@snippet lang=java :
@@ -435,14 +435,14 @@
435435
* corresponding interface to describe that element, and factory methods to
436436
* create that element. Some element kinds also have convenience methods on the
437437
* corresponding builder (e.g., {@link
438-
* CodeBuilder#invokevirtual(java.lang.constant.ClassDesc,
439-
* String, java.lang.constant.MethodTypeDesc)}).
438+
* CodeBuilder#invokevirtual(ClassDesc,
439+
* String, MethodTypeDesc)}).
440440
* <p>
441441
* Most symbolic information in elements is represented by constant pool entries
442442
* (for example, the owner of a field is represented by a {@link
443-
* java.lang.classfile.constantpool.ClassEntry}.) Factories and builders also
444-
* accept nominal descriptors from {@code java.lang.constant} (e.g., {@link
445-
* java.lang.constant.ClassDesc}.)
443+
* ClassEntry}.) Factories and builders also
444+
* accept nominal descriptors from {@link java.lang.constant} (e.g., {@link
445+
* ClassDesc}.)
446446
*
447447
* <h2><a id="data_model"></a>Data model</h2>
448448
* We define each kind of element by its name, an optional arity indicator (zero
@@ -554,4 +554,14 @@
554554
*
555555
* @since 24
556556
*/
557-
package java.lang.classfile;
557+
package java.lang.classfile;
558+
559+
import java.lang.classfile.attribute.SignatureAttribute;
560+
import java.lang.classfile.attribute.UnknownAttribute;
561+
import java.lang.classfile.constantpool.ClassEntry;
562+
import java.lang.classfile.constantpool.PoolEntry;
563+
import java.lang.classfile.constantpool.Utf8Entry;
564+
import java.lang.classfile.instruction.InvokeInstruction;
565+
import java.lang.constant.ClassDesc;
566+
import java.lang.constant.MethodTypeDesc;
567+
import java.util.function.Function;

0 commit comments

Comments
 (0)