Class ResourceFileJavaFileObject

  • All Implemented Interfaces:
    javax.tools.FileObject, javax.tools.JavaFileObject

    public class ResourceFileJavaFileObject
    extends java.lang.Object
    implements javax.tools.JavaFileObject
    A JavaFileObject that works with Ghidra's ResourceFileJavaFileManager.

    This class is used to dynamically compile Ghidra scripts.

    • Constructor Detail

      • ResourceFileJavaFileObject

        public ResourceFileJavaFileObject​(ResourceFile sourceRoot,
                                          ResourceFile file,
                                          javax.tools.JavaFileObject.Kind kind)
    • Method Detail

      • toUri

        public java.net.URI toUri()
        Specified by:
        toUri in interface javax.tools.FileObject
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface javax.tools.FileObject
      • openInputStream

        public java.io.InputStream openInputStream()
                                            throws java.io.IOException
        Specified by:
        openInputStream in interface javax.tools.FileObject
        Throws:
        java.io.IOException
      • openOutputStream

        public java.io.OutputStream openOutputStream()
                                              throws java.io.IOException
        Specified by:
        openOutputStream in interface javax.tools.FileObject
        Throws:
        java.io.IOException
      • openReader

        public java.io.Reader openReader​(boolean ignoreEncodingErrors)
                                  throws java.io.IOException
        Specified by:
        openReader in interface javax.tools.FileObject
        Throws:
        java.io.IOException
      • getCharContent

        public java.lang.CharSequence getCharContent​(boolean ignoreEncodingErrors)
                                              throws java.io.IOException
        Specified by:
        getCharContent in interface javax.tools.FileObject
        Throws:
        java.io.IOException
      • openWriter

        public java.io.Writer openWriter()
                                  throws java.io.IOException
        Specified by:
        openWriter in interface javax.tools.FileObject
        Throws:
        java.io.IOException
      • getLastModified

        public long getLastModified()
        Specified by:
        getLastModified in interface javax.tools.FileObject
      • delete

        public boolean delete()
        Specified by:
        delete in interface javax.tools.FileObject
      • getKind

        public javax.tools.JavaFileObject.Kind getKind()
        Specified by:
        getKind in interface javax.tools.JavaFileObject
      • isNameCompatible

        public boolean isNameCompatible​(java.lang.String compatibleName,
                                        javax.tools.JavaFileObject.Kind testKind)
        Specified by:
        isNameCompatible in interface javax.tools.JavaFileObject
      • getNestingKind

        public javax.lang.model.element.NestingKind getNestingKind()
        Specified by:
        getNestingKind in interface javax.tools.JavaFileObject
      • getAccessLevel

        public javax.lang.model.element.Modifier getAccessLevel()
        Specified by:
        getAccessLevel in interface javax.tools.JavaFileObject
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object