Package manifold.internal.javac
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.SortFiles
-
Nested classes/interfaces inherited from class com.sun.tools.javac.file.BaseFileManager
com.sun.tools.javac.file.BaseFileManager.ContentCacheEntry
-
Nested classes/interfaces inherited from interface javax.tools.JavaFileManager
JavaFileManager.Location
-
Nested classes/interfaces inherited from interface javax.tools.StandardJavaFileManager
StandardJavaFileManager.PathFactory
-
-
Method Summary
-
Methods inherited from class com.sun.tools.javac.file.JavacFileManager
asPath, getFileForOutput, getJavaFileObject, getJavaFileObject, getJavaFileObjects, getJavaFileObjects, getJavaFileObjects, getJavaFileObjectsFromFiles, getJavaFileObjectsFromPaths, getJavaFileObjectsFromStrings, getMessage, getRelativeName, hasExplicitLocation, isRelativeUri, isRelativeUri, isSymbolFileEnabled, preRegister, setContext, setLocation, setLocationForModule, setLocationFromPaths, setPathFactory, setSymbolFileEnabled, testName, toArray
-
Methods inherited from class com.sun.tools.javac.file.BaseFileManager
cache, createLocations, decode, deferredClose, flushCache, getCachedContent, getClassLoader, getDecoder, getEncodingName, getKind, getKind, handleOption, handleOptions, isDefaultBootClassPath, makeByteBuffer, nullCheck, nullCheck, recycleByteBuffer
-
-
-
-
Method Detail
-
getClassLoader
public ClassLoader getClassLoader(JavaFileManager.Location location)
- 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
public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file)
- Specified by:
inferBinaryNamein interfaceJavaFileManager- Overrides:
inferBinaryNamein classcom.sun.tools.javac.file.JavacFileManager
-
isSameFile
public boolean isSameFile(FileObject a, FileObject b)
- Specified by:
isSameFilein interfaceJavaFileManager- Specified by:
isSameFilein interfaceStandardJavaFileManager- Overrides:
isSameFilein classcom.sun.tools.javac.file.JavacFileManager
-
handleOption
public boolean handleOption(String current, Iterator<String> remaining)
- Specified by:
handleOptionin interfaceJavaFileManager- Overrides:
handleOptionin classcom.sun.tools.javac.file.BaseFileManager
-
hasLocation
public boolean hasLocation(JavaFileManager.Location location)
- Specified by:
hasLocationin interfaceJavaFileManager- Overrides:
hasLocationin classcom.sun.tools.javac.file.JavacFileManager
-
getLocation
public Iterable<? extends File> getLocation(JavaFileManager.Location location)
- Specified by:
getLocationin interfaceStandardJavaFileManager- Overrides:
getLocationin classcom.sun.tools.javac.file.JavacFileManager
-
getLocationAsPaths
public Collection<? extends Path> getLocationAsPaths(JavaFileManager.Location location)
- 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
public int isSupportedOption(String option)
- 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
public String inferModuleName(JavaFileManager.Location location)
- 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
public boolean contains(JavaFileManager.Location location, FileObject fo) throws IOException
- Specified by:
containsin interfaceJavaFileManager- Overrides:
containsin classcom.sun.tools.javac.file.JavacFileManager- Throws:
IOException- Since:
- 9
-
-