Class JavacFileManagerBridge<M extends JavaFileManager>
java.lang.Object
com.sun.tools.javac.file.BaseFileManager
com.sun.tools.javac.file.JavacFileManager
manifold.internal.javac.JavacFileManagerBridge<M>
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, JavaFileManager, OptionChecker, StandardJavaFileManager, PreJava17JavacFileManagerMethod
public class JavacFileManagerBridge<M extends JavaFileManager>
extends com.sun.tools.javac.file.JavacFileManager
implements PreJava17JavacFileManagerMethod
The purpose of this class is to make our ManifoldJavaFileManager a JavacFileManager, which is necessary for
straight usage of javac.exe on the command line; other javac usage such as via Maven, Gradle, and more generally
via the Java Compiler API do not require our file manager to extend JavacFileManager. Otherwise, we'd extend
ForwardingJavaFileManager.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.tools.javac.file.JavacFileManager
com.sun.tools.javac.file.JavacFileManager.SortFilesNested classes/interfaces inherited from class com.sun.tools.javac.file.BaseFileManager
com.sun.tools.javac.file.BaseFileManager.ContentCacheEntryNested classes/interfaces inherited from interface JavaFileManager
JavaFileManager.LocationNested classes/interfaces inherited from interface StandardJavaFileManager
StandardJavaFileManager.PathFactory -
Field Summary
Fields inherited from class com.sun.tools.javac.file.JavacFileManager
sortFiles, symbolFileEnabledFields inherited from class com.sun.tools.javac.file.BaseFileManager
autoClose, charset, contentCache, deferredCloseTimeout, javacFileManagerOptions, lint, locations, log, multiReleaseValue, options -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleancontains(JavaFileManager.Location location, FileObject fo) static manifold.util.ReflectUtil.LiveMethodReffindStandardJavaFileManagerMethod(JavaFileManager fm, String name, Class... params) voidflush()getClassLoader(JavaFileManager.Location location) getFileForInput(JavaFileManager.Location location, String packageName, String relativeName) getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind) getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) getLocation(JavaFileManager.Location location) Collection<? extends Path> getLocationAsPaths(JavaFileManager.Location location) getLocationForModule(JavaFileManager.Location location, String moduleName) getLocationForModule(JavaFileManager.Location location, JavaFileObject fo) <S> ServiceLoader<S> getServiceLoader(JavaFileManager.Location location, Class<S> service) booleanhandleOption(String current, Iterator<String> remaining) booleanhasLocation(JavaFileManager.Location location) inferBinaryName(JavaFileManager.Location location, JavaFileObject file) inferModuleName(JavaFileManager.Location location) booleanisSameFile(FileObject a, FileObject b) intisSupportedOption(String option) list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) Methods inherited from class com.sun.tools.javac.file.JavacFileManager
applyOptions, asPath, getFileForOutput, getJavaFileObject, getJavaFileObject, getJavaFileObjects, getJavaFileObjects, getJavaFileObjects, getJavaFileObjectsFromFiles, getJavaFileObjectsFromPaths, getJavaFileObjectsFromStrings, getMessage, getRelativeName, handleOption, hasExplicitLocation, isRelativeUri, isRelativeUri, isSymbolFileEnabled, preRegister, setContext, setLocation, setLocationForModule, setLocationFromPaths, setPathFactory, setSymbolFileEnabled, testName, toArrayMethods inherited from class com.sun.tools.javac.file.BaseFileManager
cache, clear, createLocations, decode, deferredClose, flushCache, getCachedContent, getClassLoader, getDecoder, getEncodingName, getKind, getKind, handleOptions, isDefaultBootClassPath, isDefaultSystemModulesPath, makeByteBuffer, nullCheck, nullCheck, recycleByteBuffer, resetOutputFilesWrittenMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JavaFileManager
getFileForOutputForOriginatingFiles, getJavaFileForOutputForOriginatingFilesMethods inherited from interface StandardJavaFileManager
getJavaFileObjectsFromPaths
-
Method Details
-
getClassLoader
- Specified by:
getClassLoaderin interfaceJavaFileManager- Overrides:
getClassLoaderin classcom.sun.tools.javac.file.JavacFileManager
-
list
public Iterable<JavaFileObject> list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException - Specified by:
listin interfaceJavaFileManager- Overrides:
listin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException
-
inferBinaryName
- Specified by:
inferBinaryNamein interfaceJavaFileManager- Overrides:
inferBinaryNamein classcom.sun.tools.javac.file.JavacFileManager
-
isSameFile
- Specified by:
isSameFilein interfaceJavaFileManager- Specified by:
isSameFilein interfaceStandardJavaFileManager- Overrides:
isSameFilein classcom.sun.tools.javac.file.JavacFileManager
-
handleOption
- Specified by:
handleOptionin interfaceJavaFileManager- Overrides:
handleOptionin classcom.sun.tools.javac.file.BaseFileManager
-
hasLocation
- Specified by:
hasLocationin interfaceJavaFileManager- Overrides:
hasLocationin classcom.sun.tools.javac.file.JavacFileManager
-
getLocation
- Specified by:
getLocationin interfaceStandardJavaFileManager- Overrides:
getLocationin classcom.sun.tools.javac.file.JavacFileManager
-
getLocationAsPaths
- Specified by:
getLocationAsPathsin interfacePreJava17JavacFileManagerMethod- Specified by:
getLocationAsPathsin interfaceStandardJavaFileManager- Overrides:
getLocationAsPathsin classcom.sun.tools.javac.file.JavacFileManager
-
findStandardJavaFileManagerMethod
public static manifold.util.ReflectUtil.LiveMethodRef findStandardJavaFileManagerMethod(JavaFileManager fm, String name, Class... params) -
isSupportedOption
- Specified by:
isSupportedOptionin interfaceOptionChecker- Overrides:
isSupportedOptionin classcom.sun.tools.javac.file.BaseFileManager
-
getJavaFileForInput
public JavaFileObject getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind) throws IOException - Specified by:
getJavaFileForInputin interfaceJavaFileManager- Overrides:
getJavaFileForInputin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException
-
getJavaFileForOutput
public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException - Specified by:
getJavaFileForOutputin interfaceJavaFileManager- Overrides:
getJavaFileForOutputin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException
-
getFileForInput
public FileObject getFileForInput(JavaFileManager.Location location, String packageName, String relativeName) throws IOException - Specified by:
getFileForInputin interfaceJavaFileManager- Overrides:
getFileForInputin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException
-
getFileForOutput
public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException - Specified by:
getFileForOutputin interfaceJavaFileManager- Overrides:
getFileForOutputin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException
-
flush
public void flush()- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceJavaFileManager- Overrides:
flushin classcom.sun.tools.javac.file.JavacFileManager
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceJavaFileManager- Overrides:
closein classcom.sun.tools.javac.file.JavacFileManager
-
getLocationForModule
public JavaFileManager.Location getLocationForModule(JavaFileManager.Location location, String moduleName) throws IOException - Specified by:
getLocationForModulein interfaceJavaFileManager- Overrides:
getLocationForModulein classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException- Since:
- 9
-
getLocationForModule
public JavaFileManager.Location getLocationForModule(JavaFileManager.Location location, JavaFileObject fo) throws IOException - Specified by:
getLocationForModulein interfaceJavaFileManager- Overrides:
getLocationForModulein classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException- Since:
- 9
-
getServiceLoader
public <S> ServiceLoader<S> getServiceLoader(JavaFileManager.Location location, Class<S> service) throws IOException - Specified by:
getServiceLoaderin interfaceJavaFileManager- Overrides:
getServiceLoaderin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException- Since:
- 9
-
inferModuleName
- Specified by:
inferModuleNamein interfaceJavaFileManager- Overrides:
inferModuleNamein classcom.sun.tools.javac.file.JavacFileManager- Since:
- 9
-
listLocationsForModules
public Iterable<Set<JavaFileManager.Location>> listLocationsForModules(JavaFileManager.Location location) throws IOException - Specified by:
listLocationsForModulesin interfaceJavaFileManager- Overrides:
listLocationsForModulesin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException- Since:
- 9
-
contains
- Specified by:
containsin interfaceJavaFileManager- Overrides:
containsin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException- Since:
- 9
-