public class JavaInMemoryFileManager extends ForwardingJavaFileManager<StandardJavaFileManager> implements StandardJavaFileManager
StandardJavaFileManager
that creates and writes the content of files directly into a
Jar output stream instead of writing the files to disk.JavaFileManager.Location
fileManager
Constructor and Description |
---|
JavaInMemoryFileManager(StandardJavaFileManager standardManager,
Path jarPath,
java.util.function.Predicate<? super String> removeClassesPredicate) |
close, flush, getClassLoader, getFileForInput, getJavaFileForInput, handleOption, hasLocation, inferBinaryName, isSupportedOption
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, flush, getClassLoader, getFileForInput, getJavaFileForInput, handleOption, hasLocation, inferBinaryName
isSupportedOption
public JavaInMemoryFileManager(StandardJavaFileManager standardManager, Path jarPath, java.util.function.Predicate<? super String> removeClassesPredicate)
public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException
getJavaFileForOutput
in interface JavaFileManager
getJavaFileForOutput
in class ForwardingJavaFileManager<StandardJavaFileManager>
IOException
public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException
getFileForOutput
in interface JavaFileManager
getFileForOutput
in class ForwardingJavaFileManager<StandardJavaFileManager>
IOException
public boolean isSameFile(FileObject a, FileObject b)
isSameFile
in interface JavaFileManager
isSameFile
in interface StandardJavaFileManager
isSameFile
in class ForwardingJavaFileManager<StandardJavaFileManager>
public Iterable<? extends JavaFileObject> getJavaFileObjectsFromFiles(Iterable<? extends File> files)
getJavaFileObjectsFromFiles
in interface StandardJavaFileManager
public Iterable<? extends JavaFileObject> getJavaFileObjects(File... files)
getJavaFileObjects
in interface StandardJavaFileManager
public Iterable<? extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable<String> names)
getJavaFileObjectsFromStrings
in interface StandardJavaFileManager
public Iterable<? extends JavaFileObject> getJavaFileObjects(String... names)
getJavaFileObjects
in interface StandardJavaFileManager
public void setLocation(JavaFileManager.Location location, Iterable<? extends File> path) throws IOException
setLocation
in interface StandardJavaFileManager
IOException
public Iterable<? extends File> getLocation(JavaFileManager.Location location)
getLocation
in interface StandardJavaFileManager
public Iterable<JavaFileObject> list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException
list
in interface JavaFileManager
list
in class ForwardingJavaFileManager<StandardJavaFileManager>
IOException
public com.google.common.collect.ImmutableSet<String> writeToJar(JarBuilder jarBuilder)