DocumentationTool.Location
, StandardLocation
JavaFileManager
public static interface JavaFileManager.Location
Informally, a Location
corresponds to a "search path", such as a class path or module path, as used by command-line tools that use the default file system.
Some locations are typically used to identify a place in which a tool can find files to be read; others are typically used to identify a place where a tool can write files. If a location is used to identify a place for reading files, those files may be organized in a simple package/class hierarchy: such locations are described as package-oriented. Alternatively, the files may be organized in a module/package/class hierarchy: such locations are described as module-oriented. If a location is typically used to identify a place where a tool can write files, it is up to the tool that writes the files to specify how those files will be organized.
You can access the classes in a package-oriented location using methods like JavaFileManager.getJavaFileForInput(javax.tools.JavaFileManager.Location, java.lang.String, javax.tools.JavaFileObject.Kind)
or JavaFileManager.list(javax.tools.JavaFileManager.Location, java.lang.String, java.util.Set<javax.tools.JavaFileObject.Kind>, boolean)
. It is not possible to directly list the classes in a module-oriented location. Instead, you can get a package-oriented location for any specific module using methods like JavaFileManager.getLocationForModule(javax.tools.JavaFileManager.Location, java.lang.String)
or JavaFileManager.listLocationsForModules(javax.tools.JavaFileManager.Location)
.
Modifier and Type | Method | Description |
---|---|---|
String |
getName() |
Returns the name of this location. |
default boolean |
isModuleOrientedLocation() |
Indicates if this location is module-oriented location, and therefore expected to contain classes in a module/package/class hierarchy, as compared to a package-oriented location, which is expected to contain classes in a package/class hierarchy. |
boolean |
isOutputLocation() |
Determines if this is an output location. |
String getName()
boolean isOutputLocation()
default boolean isModuleOrientedLocation()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.compiler/javax/tools/JavaFileManager.Location.html