Unless stated otherwise, references in this class to "this file manager" should be interpreted as referring indirectly to the delegate file manager.
| Modifier and Type | Field and Description |
|---|---|
| protected final M | fileManager
The file manager to which all methods are delegated. |
| Access | Constructor and Description |
|---|---|
| protected | ForwardingJavaFileManager(M
delegate to this file manager fileManager)Creates a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements javax. Releases any resources opened by this file manager directly or indirectly. |
| public boolean | contains(JavaFileManager.
Overrides default javax. Determines whether or not a given file object is "contained in" a specified location. |
| public void | flush()
Implements javax. Flushes any resources opened for output by this file manager directly or indirectly. |
| public ClassLoader | getClassLoader(JavaFileManager.
Implements javax. Returns a class loader for loading plug-ins from the given package-oriented location. |
| public FileObject | getFileForInput(JavaFileManager.
Implements javax. Returns a file object for input representing the specified relative name in the specified package in the given package-oriented location. |
| public FileObject | getFileForOutput(JavaFileManager.
Implements javax. Returns a file object for output representing the specified relative name in the specified package in the given location. |
| public FileObject | getFileForOutputForOriginatingFiles(JavaFileManager.
Overrides default javax. Returns a file object for output representing the specified relative name in the specified package in the given location. |
| public JavaFileObject | getJavaFileForInput(JavaFileManager.
Implements javax. Returns a file object for input representing the specified class of the specified kind in the given package-oriented location. |
| public JavaFileObject | getJavaFileForOutput(JavaFileManager.
Implements javax. Returns a file object for output representing the specified class of the specified kind in the given package-oriented location. |
| public JavaFileObject | getJavaFileForOutputForOriginatingFiles(JavaFileManager.
Overrides default javax. Returns a file object for output representing the specified class of the specified kind in the given package-oriented location. |
| public JavaFileManager. | getLocationForModule(JavaFileManager.
Overrides default javax. Gets a location for a named module within a location, which may be either a module-oriented location or an output location. |
| public JavaFileManager. | getLocationForModule(JavaFileManager.
Overrides default javax. Gets a location for the module containing a specific file to be found within a location, which may be either a module-oriented location or an output location. |
| public <S> ServiceLoader | getServiceLoader(JavaFileManager.
Overrides default javax. Get a service loader for a specific service class from a given location. |
| public boolean | handleOption(String current, Iterator<String> remaining)
Implements javax. Handles one option. |
| public boolean | hasLocation(JavaFileManager.
Implements javax. Determines if a location is known to this file manager. |
| public String | inferBinaryName(JavaFileManager.
Implements javax. Infers a binary name of a file object based on a package-oriented location. |
| public String | inferModuleName(JavaFileManager.
Overrides default javax. Infer the name of the module from its location, as returned by
|
| public boolean | isSameFile(FileObject a, FileObject b)
Implements javax. Compares two file objects and returns true if they represent the same underlying object. |
| public int | isSupportedOption(String option)
Implements javax. Determines if the given option is supported and if so, the number of arguments the option takes. |
| public Iterable | list(JavaFileManager.
Implements javax. Lists all file objects matching the given criteria in the given package-oriented location. |
| public Iterable | listLocationsForModules(JavaFileManager.
Overrides default javax. Lists the locations for all the modules in a module-oriented location or an output location. |
| fileManager | back to summary |
|---|---|
| protected final M fileManager The file manager to which all methods are delegated. | |
| ForwardingJavaFileManager | back to summary |
|---|---|
| protected ForwardingJavaFileManager(M fileManager) Creates a new instance of
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements javax. Doc from javax. Releases any resources opened by this file manager directly or indirectly. This might render this file manager useless and the effect of subsequent calls to methods on this object or any objects obtained through this object is undefined unless explicitly allowed. However, closing a file manager which has already been closed has no effect.
| |
| contains | back to summary |
|---|---|
| public boolean contains(JavaFileManager. Overrides default javax. Doc from javax. Determines whether or not a given file object is "contained in" a specified location. For a package-oriented location, a file object is contained in the location if there exist
values for packageName and relativeName such that either of the following
calls would return the getFileForInput(location, packageName, relativeName) getFileForOutput(location, packageName, relativeName, null) For a module-oriented location, a file object is contained in the location if there exists a module that may be obtained by the call: getLocationForModule(location, moduleName)
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements javax. Doc from javax. Flushes any resources opened for output by this file manager directly or indirectly. Flushing a closed file manager has no effect.
| |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader(JavaFileManager. Implements javax. Doc from javax. Returns a class loader for loading plug-ins from the given
package-oriented location.
For example, to load annotation processors,
a compiler will request a class loader for the
| |
| getFileForInput | back to summary |
|---|---|
| public FileObject getFileForInput(JavaFileManager. Implements javax. Doc from javax. Returns a file object for input representing the specified relative name in the specified package in the given package-oriented location. If the returned object represents a source or class file, it must be an instance
of Informally, the file object returned by this method is located in the concatenation of the location, package name, and relative name. For example, to locate the properties file "resources/compiler.properties" in the package "com.sun.tools.javac" in the SOURCE_PATH location, this method might be called like so: getFileForInput(SOURCE_PATH, "com.sun.tools.javac", "resources/compiler.properties"); If the call was executed on Windows, with SOURCE_PATH set to
| |
| getFileForOutput | back to summary |
|---|---|
| public FileObject getFileForOutput(JavaFileManager. Implements javax. Doc from javax. Returns a file object for output representing the specified relative name in the specified package in the given location. Optionally, this file manager might consider the sibling as a hint for where to place the output. The exact semantics of this hint is unspecified. The JDK compiler, javac, for example, will place class files in the same directories as originating source files unless a class file output directory is provided. To facilitate this behavior, javac might provide the originating source file as sibling when calling this method. If the returned object represents a source or class file, it must be an instance
of Informally, the file object returned by this method is
located in the concatenation of the location, package name, and
relative name or next to the sibling argument. See
| |
| getFileForOutputForOriginatingFiles | back to summary |
|---|---|
| public FileObject getFileForOutputForOriginatingFiles(JavaFileManager. Overrides default javax. Doc from javax. Returns a file object for output representing the specified relative name in the specified package in the given location. The provided If the returned object represents a source or class file, it must be an instance
of Informally, the file object returned by this method is
located in the concatenation of the location, package name, and
relative name or in a location inferred from the Implementation Specification If the subclass of the
| |
| getJavaFileForInput | back to summary |
|---|---|
| public JavaFileObject getJavaFileForInput(JavaFileManager. Implements javax. Doc from javax. Returns a file object for input representing the specified class of the specified kind in the given package-oriented location.
| |
| getJavaFileForOutput | back to summary |
|---|---|
| public JavaFileObject getJavaFileForOutput(JavaFileManager. Implements javax. Doc from javax. Returns a file object for output representing the specified class of the specified kind in the given package-oriented location. Optionally, this file manager might consider the sibling as a hint for where to place the output. The exact semantics of this hint is unspecified. The JDK compiler, javac, for example, will place class files in the same directories as originating source files unless a class file output directory is provided. To facilitate this behavior, javac might provide the originating source file as sibling when calling this method.
| |
| getJavaFileForOutputForOriginatingFiles | back to summary |
|---|---|
| public JavaFileObject getJavaFileForOutputForOriginatingFiles(JavaFileManager. Overrides default javax. Doc from javax. Returns a file object for output representing the specified class of the specified kind in the given package-oriented location. The provided Implementation Specification If the subclass of the
| |
| getLocationForModule | back to summary |
|---|---|
| public JavaFileManager. Overrides default javax. Doc from javax. Gets a location for a named module within a location, which may be either a module-oriented location or an output location. The result will be an output location if the given location is an output location, or it will be a package-oriented location.
| |
| getLocationForModule | back to summary |
|---|---|
| public JavaFileManager. Overrides default javax. Doc from javax. Gets a location for the module containing a specific file to be found within a location, which may be either a module-oriented location or an output location. The result will be an output location if the given location is an output location, or it will be a package-oriented location.
| |
| getServiceLoader | back to summary |
|---|---|
| public <S> ServiceLoader Overrides default javax. Doc from javax. Get a service loader for a specific service class from a given location.
If the location is a module-oriented location, the service loader will use the
service declarations in the modules found in that location. Otherwise, a service loader
is created using the package-oriented location, in which case, the services are
determined using the provider-configuration files in
| |
| handleOption | back to summary |
|---|---|
| public boolean handleOption(String current, Iterator<String> remaining) Implements javax. Doc from javax. Handles one option. If
| |
| hasLocation | back to summary |
|---|---|
| public boolean hasLocation(JavaFileManager. Implements javax. Doc from javax. Determines if a location is known to this file manager.
| |
| inferBinaryName | back to summary |
|---|---|
| public String inferBinaryName(JavaFileManager. Implements javax. Doc from javax. Infers a binary name of a file object based on a package-oriented location. The binary name returned might not be a valid binary name according to The Java Language Specification.
| |
| inferModuleName | back to summary |
|---|---|
| public String inferModuleName(JavaFileManager. Overrides default javax. Doc from javax. Infer the name of the module from its location, as returned by
| |
| isSameFile | back to summary |
|---|---|
| public boolean isSameFile(FileObject a, FileObject b) Implements javax. Doc from javax. Compares two file objects and returns true if they represent the same underlying object.
| |
| isSupportedOption | back to summary |
|---|---|
| public int isSupportedOption(String option) Implements javax. Doc from javax. Determines if the given option is supported and if so, the number of arguments the option takes.
| |
| list | back to summary |
|---|---|
| public Iterable Implements javax. Doc from javax. Lists all file objects matching the given criteria in the given package-oriented location. List file objects in "subpackages" if recurse is true. Note even if the given location is unknown to this file
manager, it may not return
| |
| listLocationsForModules | back to summary |
|---|---|
| public Iterable Overrides default javax. Doc from javax. Lists the locations for all the modules in a module-oriented location or an output location. The locations that are returned will be output locations if the given location is an output, or it will be a package-oriented locations.
| |