66
66
* <p>The file creation methods take a variable number of arguments to
67
67
* allow the <em>originating elements</em> to be provided as hints to
68
68
* the tool infrastructure to better manage dependencies. The
69
- * originating elements are the types or packages (representing {@code
70
- * package-info} files) or modules (representing {@code
71
- * module-info} files) which caused an annotation processor to
69
+ * originating elements are the classes or interfaces or packages
70
+ * (representing {@code package-info} files) or modules (representing
71
+ * {@code module-info} files) which caused an annotation processor to
72
72
* attempt to create a new file. For example, if an annotation
73
73
* processor tries to create a source file, {@code
74
74
* GeneratedFromUserSource}, in response to processing
107
107
* <p> In general, processors must not knowingly attempt to overwrite
108
108
* existing files that were not generated by some processor. A {@code
109
109
* Filer} may reject attempts to open a file corresponding to an
110
- * existing type , like {@code java.lang.Object}. Likewise, the
110
+ * existing class or interface , like {@code java.lang.Object}. Likewise, the
111
111
* invoker of the annotation processing tool must not knowingly
112
112
* configure the tool such that the discovered processors will attempt
113
113
* to overwrite existing files that were not generated.
114
114
*
115
115
* <p> Processors can indicate a source or class file is generated by
116
- * including a {@link javax.annotation.processing.Generated} annotation if the
117
- * environment is configured so that that type is accessible.
116
+ * including a {@link javax.annotation.processing.Generated}
117
+ * annotation if the environment is configured so that that class or
118
+ * interface is accessible.
118
119
*
119
120
* @apiNote Some of the effect of overwriting a file can be
120
121
* achieved by using a <i>decorator</i>-style pattern. Instead of
133
134
public interface Filer {
134
135
/**
135
136
* Creates a new source file and returns an object to allow
136
- * writing to it. A source file for a type, or a package can
137
- * be created.
137
+ * writing to it. A source file for a class, interface, or a
138
+ * package can be created.
138
139
*
139
140
* The file's name and path (relative to the {@linkplain
140
141
* StandardLocation#SOURCE_OUTPUT root output location for source
141
142
* files}) are based on the name of the item to be declared in
142
143
* that file as well as the specified module for the item (if
143
144
* any).
144
145
*
145
- * If more than one type is being declared in a single file (that
146
+ * If more than one class or interface is being declared in a single file (that
146
147
* is, a single compilation unit), the name of the file should
147
- * correspond to the name of the principal top-level type (the
148
+ * correspond to the name of the principal top-level class or interface (the
148
149
* public one, for example).
149
150
*
150
151
* <p>A source file can also be created to hold information about
@@ -155,7 +156,7 @@ public interface Filer {
155
156
*
156
157
* <p>The optional module name is prefixed to the type name or
157
158
* package name and separated using a "{@code /}" character. For
158
- * example, to create a source file for type {@code a.B} in module
159
+ * example, to create a source file for class {@code a.B} in module
159
160
* {@code foo}, use a {@code name} argument of {@code "foo/a.B"}.
160
161
*
161
162
* <p>If no explicit module prefix is given and modules are supported
@@ -164,7 +165,7 @@ public interface Filer {
164
165
* An implementation may use information about the configuration of
165
166
* the annotation processing tool as part of the inference.
166
167
*
167
- * <p>Creating a source file in or for an unnamed package in a named
168
+ * <p>Creating a source file in or for an <em> unnamed</em> package in a <em> named</em>
168
169
* module is <em>not</em> supported.
169
170
*
170
171
* @apiNote To use a particular {@linkplain
@@ -194,15 +195,15 @@ public interface Filer {
194
195
* as the target module. A separate option may be used to provide the target
195
196
* module if it cannot be determined using the above rules.
196
197
*
197
- * @param name canonical (fully qualified) name of the principal type
198
+ * @param name canonical (fully qualified) name of the principal class or interface
198
199
* being declared in this file or a package name followed by
199
200
* {@code ".package-info"} for a package information file
200
- * @param originatingElements type or package or module elements causally
201
- * associated with the creation of this file, may be elided or
202
- * {@code null}
201
+ * @param originatingElements class, interface, package, or module
202
+ * elements causally associated with the creation of this file,
203
+ * may be elided or {@code null}
203
204
* @return a {@code JavaFileObject} to write the new source file
204
205
* @throws FilerException if the same pathname has already been
205
- * created, the same type has already been created, the name is
206
+ * created, the same class or interface has already been created, the name is
206
207
* otherwise not valid for the entity requested to being created,
207
208
* if the target module cannot be determined, if the target
208
209
* module is not writable, or a module is specified when the environment
@@ -215,7 +216,7 @@ JavaFileObject createSourceFile(CharSequence name,
215
216
216
217
/**
217
218
* Creates a new class file, and returns an object to allow
218
- * writing to it. A class file for a type , or a package can
219
+ * writing to it. A class file for a class, interface , or a package can
219
220
* be created.
220
221
*
221
222
* The file's name and path (relative to the {@linkplain
@@ -231,7 +232,7 @@ JavaFileObject createSourceFile(CharSequence name,
231
232
*
232
233
* <p>The optional module name is prefixed to the type name or
233
234
* package name and separated using a "{@code /}" character. For
234
- * example, to create a class file for type {@code a.B} in module
235
+ * example, to create a class file for class {@code a.B} in module
235
236
* {@code foo}, use a {@code name} argument of {@code "foo/a.B"}.
236
237
*
237
238
* <p>If no explicit module prefix is given and modules are supported
@@ -240,7 +241,7 @@ JavaFileObject createSourceFile(CharSequence name,
240
241
* An implementation may use information about the configuration of
241
242
* the annotation processing tool as part of the inference.
242
243
*
243
- * <p>Creating a class file in or for an unnamed package in a named
244
+ * <p>Creating a class file in or for an <em> unnamed</em> package in a <em> named</em>
244
245
* module is <em>not</em> supported.
245
246
*
246
247
* @apiNote To avoid subsequent errors, the contents of the class
@@ -259,15 +260,16 @@ JavaFileObject createSourceFile(CharSequence name,
259
260
* as the target module. A separate option may be used to provide the target
260
261
* module if it cannot be determined using the above rules.
261
262
*
262
- * @param name binary name of the type being written or a package name followed by
263
- * {@code ".package-info"} for a package information file
264
- * @param originatingElements type or package or module elements causally
265
- * associated with the creation of this file, may be elided or
266
- * {@code null}
263
+ * @param name binary name of the class or interface being written
264
+ * or a package name followed by {@code ".package-info"} for a
265
+ * package information file
266
+ * @param originatingElements class or interface or package or
267
+ * module elements causally associated with the creation of this
268
+ * file, may be elided or {@code null}
267
269
* @return a {@code JavaFileObject} to write the new class file
268
270
* @throws FilerException if the same pathname has already been
269
- * created, the same type has already been created, the name is
270
- * not valid for a type , if the target module cannot be determined,
271
+ * created, the same class or interface has already been created, the name is
272
+ * not valid for a class or interface , if the target module cannot be determined,
271
273
* if the target module is not writable, or a module is specified when
272
274
* the environment doesn't support modules.
273
275
* @throws IOException if the file cannot be created
@@ -330,8 +332,9 @@ JavaFileObject createClassFile(CharSequence name,
330
332
* @param moduleAndPkg module and/or package relative to which the file
331
333
* should be named, or the empty string if none
332
334
* @param relativeName final pathname components of the file
333
- * @param originatingElements type or package or module elements causally
334
- * associated with the creation of this file, may be elided or
335
+ * @param originatingElements class or interface or package or
336
+ * module elements causally associated with the creation of this
337
+ * file, may be elided or
335
338
* {@code null}
336
339
* @return a {@code FileObject} to write the new resource
337
340
* @throws IOException if the file cannot be created
0 commit comments