Class Jsr199JavaCompiler

  • All Implemented Interfaces:
    JavaCompiler

    public class Jsr199JavaCompiler
    extends java.lang.Object
    implements JavaCompiler
    Invoke Java Compiler per JSR 199, using in-memory storage for both the input Java source and the generated bytecodes.
    • Field Detail

      • cpath

        protected java.util.List<java.io.File> cpath
      • options

        protected java.util.ArrayList<java.lang.String> options
      • charArrayWriter

        protected java.io.CharArrayWriter charArrayWriter
      • javaFileName

        protected java.lang.String javaFileName
      • javaEncoding

        protected java.lang.String javaEncoding
    • Constructor Detail

      • Jsr199JavaCompiler

        public Jsr199JavaCompiler()
    • Method Detail

      • release

        public void release()
        Description copied from interface: JavaCompiler
        Release resouces used in the current compilation
        Specified by:
        release in interface JavaCompiler
      • setClassPath

        public void setClassPath​(java.util.List<java.io.File> path)
        Description copied from interface: JavaCompiler
        Java Compiler options.
        Specified by:
        setClassPath in interface JavaCompiler
      • setExtdirs

        public void setExtdirs​(java.lang.String exts)
        Specified by:
        setExtdirs in interface JavaCompiler
      • setSourceVM

        public void setSourceVM​(java.lang.String sourceVM)
        Specified by:
        setSourceVM in interface JavaCompiler
      • setTargetVM

        public void setTargetVM​(java.lang.String targetVM)
        Specified by:
        setTargetVM in interface JavaCompiler
      • saveClassFile

        public void saveClassFile​(java.lang.String className,
                                  java.lang.String classFileName)
        Description copied from interface: JavaCompiler
        Save the generated class file to disk, if not already done.
        Specified by:
        saveClassFile in interface JavaCompiler
      • setDebug

        public void setDebug​(boolean debug)
        Specified by:
        setDebug in interface JavaCompiler
      • getJavaWriter

        public java.io.Writer getJavaWriter​(java.lang.String javaFileName,
                                            java.lang.String javaEncoding)
        Description copied from interface: JavaCompiler
        Get a Writer for the Java file. The writer is used by JSP compiler. This method allows the Java compiler control where the Java file should be generated so it knows how to handle the input for java compilation accordingly.
        Specified by:
        getJavaWriter in interface JavaCompiler
      • getOutputFile

        protected javax.tools.JavaFileObject getOutputFile​(java.lang.String className,
                                                           java.net.URI uri)
      • getJavaFileManager

        protected javax.tools.JavaFileManager getJavaFileManager​(javax.tools.JavaFileManager fm)