- All Superinterfaces:
AutoCloseable,Closeable,Flushable,JavaFileManager,OptionChecker
JavaFileManager that allows adding of PathRoot objects to the
manager.- Since:
- 0.0.1
- Author:
- Ashley Scopes
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.tools.JavaFileManager
JavaFileManager.Location -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPath(JavaFileManager.Location location, PathRoot path) Add a package-oriented path to a given location.voidaddPaths(JavaFileManager.Location location, Collection<? extends PathRoot> paths) Add a collection of package-oriented paths to a given location.voidCopy all containers from the first location to the second location.voidcreateEmptyLocation(JavaFileManager.Location location) Register an empty container for the given location to indicate to the compiler that the feature exists, but has no configured paths.Get the associated effective release.Get the container group for the given module-oriented location.Get a collection of all module container impl in this file manager.Get the container group for the given output-oriented location.Get a collection of all output container impl in this file manager.Get the container group for the given package-oriented location.Get a collection of all package container impl in this file manager.list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) List all file objects in the given location matching the given criteria.Methods inherited from interface javax.tools.JavaFileManager
close, contains, flush, getClassLoader, getFileForInput, getFileForOutput, getJavaFileForInput, getJavaFileForOutput, getLocationForModule, getLocationForModule, getServiceLoader, handleOption, hasLocation, inferBinaryName, inferModuleName, isSameFile, listLocationsForModulesMethods inherited from interface javax.tools.OptionChecker
isSupportedOption
-
Method Details
-
addPath
Add a package-oriented path to a given location.To add a module, first obtain the module location using
JavaFileManager.getLocationForModule(Location, String), and pass that result to this call.- Parameters:
location- the location to use.path- the path to add.- See Also:
-
addPaths
Add a collection of package-oriented paths to a given location.To add a module, first obtain the module location using
JavaFileManager.getLocationForModule(Location, String), and pass that result to this call.- Parameters:
location- the location to use.paths- the paths to add.- See Also:
-
copyContainers
Copy all containers from the first location to the second location.- Parameters:
from- the first location.to- the second location.
-
createEmptyLocation
Register an empty container for the given location to indicate to the compiler that the feature exists, but has no configured paths.This is needed to coerce the behaviour for annotation processing in some cases.
If the location already exists, then do not do anything.
If the location is an output location, then this operation does not make any sense, since an empty location cannot have files output to it. In this case, you will likely get an exception.
Likewise, this operation does not make sense for module locations within a module-oriented location group, so this operation will fail with an error for those inputs as well.
- Parameters:
location- the location to apply an empty container for.- Throws:
IllegalArgumentException- if the location is an output location or a module location.
-
getEffectiveRelease
Get the associated effective release.- Returns:
- the effective release.
- Since:
- 0.0.1 (0.0.1-M8)
-
getPackageContainerGroup
Get the container group for the given package-oriented location.- Parameters:
location- the package oriented location.- Returns:
- the container group, or null if one does not exist.
-
getPackageContainerGroups
Get a collection of all package container impl in this file manager.- Returns:
- the package container impl.
-
getModuleContainerGroup
Get the container group for the given module-oriented location.- Parameters:
location- the module oriented location.- Returns:
- the container group, or null if one does not exist.
-
getModuleContainerGroups
Get a collection of all module container impl in this file manager.- Returns:
- the module container impl.
-
getOutputContainerGroup
Get the container group for the given output-oriented location.- Parameters:
location- the output oriented location.- Returns:
- the container group, or null if one does not exist.
-
getOutputContainerGroups
Get a collection of all output container impl in this file manager.- Returns:
- the output container impl.
-
list
Set<JavaFileObject> list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException List all file objects in the given location matching the given criteria.- Specified by:
listin interfaceJavaFileManager- Parameters:
location- the location to search in.packageName- the package name to search in, or""to search in the root location.kinds- the kinds of file to return, orSet.of()(JavaFileObject.Kind.OTHER)to find all files.recurse-trueto recurse into subpackages,falseto only check the current package.- Returns:
- a collection of unique file objects that were found.
- Throws:
IOException- if an IO error occurs reading the file system.
-