Package ghidra.app.script
Class ResourceFileJavaFileManager
java.lang.Object
ghidra.app.script.ResourceFileJavaFileManager
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,JavaFileManager,OptionChecker
A
JavaFileManager that works with Ghidra's ResourceFiles.
This class is used to dynamically compile Ghidra scripts.
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.tools.JavaFileManager
JavaFileManager.Location -
Constructor Summary
ConstructorsConstructorDescriptionResourceFileJavaFileManager(List<ResourceFile> sourceDirs, Set<ResourceFile> filesToAvoid) Create aJavaFileManagerfor use by theJavaCompiler. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleancontains(JavaFileManager.Location location, FileObject fo) 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) 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.tools.JavaFileManager
getFileForOutputForOriginatingFiles, getJavaFileForOutputForOriginatingFiles
-
Constructor Details
-
ResourceFileJavaFileManager
Create aJavaFileManagerfor use by theJavaCompiler.- Parameters:
sourceDirs- the directories containing sourcefilesToAvoid- known "bad" files to hide from the compiler
-
-
Method Details
-
isSupportedOption
- Specified by:
isSupportedOptionin interfaceOptionChecker
-
getClassLoader
- Specified by:
getClassLoaderin interfaceJavaFileManager
-
list
public Iterable<JavaFileObject> list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException - Specified by:
listin interfaceJavaFileManager- Throws:
IOException
-
inferBinaryName
- Specified by:
inferBinaryNamein interfaceJavaFileManager
-
isSameFile
- Specified by:
isSameFilein interfaceJavaFileManager
-
handleOption
- Specified by:
handleOptionin interfaceJavaFileManager
-
hasLocation
- Specified by:
hasLocationin interfaceJavaFileManager
-
getJavaFileForInput
public JavaFileObject getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind) throws IOException - Specified by:
getJavaFileForInputin interfaceJavaFileManager- Throws:
IOException
-
getJavaFileForOutput
public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException - Specified by:
getJavaFileForOutputin interfaceJavaFileManager- Throws:
IOException
-
getFileForInput
public FileObject getFileForInput(JavaFileManager.Location location, String packageName, String relativeName) throws IOException - Specified by:
getFileForInputin interfaceJavaFileManager- Throws:
IOException
-
getFileForOutput
public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException - Specified by:
getFileForOutputin interfaceJavaFileManager- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceJavaFileManager- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceJavaFileManager- Throws:
IOException
-
getLocationForModule
public JavaFileManager.Location getLocationForModule(JavaFileManager.Location location, String moduleName) throws IOException - Specified by:
getLocationForModulein interfaceJavaFileManager- Throws:
IOException
-
getLocationForModule
public JavaFileManager.Location getLocationForModule(JavaFileManager.Location location, JavaFileObject fo) throws IOException - Specified by:
getLocationForModulein interfaceJavaFileManager- Throws:
IOException
-
inferModuleName
- Specified by:
inferModuleNamein interfaceJavaFileManager- Throws:
IOException
-
listLocationsForModules
public Iterable<Set<JavaFileManager.Location>> listLocationsForModules(JavaFileManager.Location location) throws IOException - Specified by:
listLocationsForModulesin interfaceJavaFileManager- Throws:
IOException
-
contains
- Specified by:
containsin interfaceJavaFileManager- Throws:
IOException
-
getServiceLoader
public <S> ServiceLoader<S> getServiceLoader(JavaFileManager.Location location, Class<S> service) throws IOException - Specified by:
getServiceLoaderin interfaceJavaFileManager- Throws:
IOException
-