Package com.karuslabs.elementary.file
Class MemoryFileManager
java.lang.Object
com.karuslabs.elementary.file.ForwardingFileManager
com.karuslabs.elementary.file.MemoryFileManager
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,JavaFileManager,OptionChecker,StandardJavaFileManager
A file manager that stores all output in memory.
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.tools.JavaFileManager
JavaFileManager.LocationNested classes/interfaces inherited from interface javax.tools.StandardJavaFileManager
StandardJavaFileManager.PathFactory -
Constructor Summary
ConstructorsConstructorDescriptionMemoryFileManager(StandardJavaFileManager manager) Creates aMemoryFileManagerwith the given underlying manager. -
Method Summary
Modifier and TypeMethodDescriptionReturns the generated Java source files.getFileForInput(JavaFileManager.Location location, String pack, String relative) getFileForOutput(JavaFileManager.Location location, String pack, String relative, FileObject sibling) getJavaFileForInput(JavaFileManager.Location location, String type, JavaFileObject.Kind kind) getJavaFileForOutput(JavaFileManager.Location location, String type, JavaFileObject.Kind kind, FileObject sibling) booleanisSameFile(FileObject a, FileObject b) Determines if the twoFileObjects are equal by comparing their URIs.Returns the output files.Methods inherited from class com.karuslabs.elementary.file.ForwardingFileManager
asPath, close, contains, flush, getClassLoader, getJavaFileObjects, getJavaFileObjects, getJavaFileObjectsFromFiles, getJavaFileObjectsFromStrings, getLocation, getLocationForModule, getLocationForModule, getServiceLoader, handleOption, hasLocation, inferBinaryName, inferModuleName, isSupportedOption, list, listLocationsForModules, setLocation, setLocationForModule, setLocationFromPaths, setPathFactoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.tools.StandardJavaFileManager
getJavaFileObjects, getJavaFileObjectsFromPaths, getJavaFileObjectsFromPaths, getLocationAsPaths
-
Constructor Details
-
MemoryFileManager
Creates aMemoryFileManagerwith the given underlying manager.- Parameters:
manager- the underlying file manager
-
-
Method Details
-
isSameFile
Determines if the twoFileObjects are equal by comparing their URIs.- Specified by:
isSameFilein interfaceJavaFileManager- Specified by:
isSameFilein interfaceStandardJavaFileManager- Overrides:
isSameFilein classForwardingFileManager- Parameters:
a- the firstFileObjectb- the secondFileObject- Returns:
trueif the URIs of the twoFileObjects are equal
-
getFileForInput
public @Nullable FileObject getFileForInput(JavaFileManager.Location location, String pack, String relative) throws IOException - Specified by:
getFileForInputin interfaceJavaFileManager- Overrides:
getFileForInputin classForwardingFileManager- Throws:
IOException
-
getJavaFileForInput
public @Nullable JavaFileObject getJavaFileForInput(JavaFileManager.Location location, String type, JavaFileObject.Kind kind) throws IOException - Specified by:
getJavaFileForInputin interfaceJavaFileManager- Overrides:
getJavaFileForInputin classForwardingFileManager- Throws:
IOException
-
getFileForOutput
public FileObject getFileForOutput(JavaFileManager.Location location, String pack, String relative, FileObject sibling) - Specified by:
getFileForOutputin interfaceJavaFileManager- Overrides:
getFileForOutputin classForwardingFileManager
-
getJavaFileForOutput
public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String type, JavaFileObject.Kind kind, FileObject sibling) - Specified by:
getJavaFileForOutputin interfaceJavaFileManager- Overrides:
getJavaFileForOutputin classForwardingFileManager
-
generatedSources
Returns the generated Java source files.- Returns:
- the generated Java source files
-
outputFiles
Returns the output files.- Returns:
- the output files
-