Interface ICookable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void cook​(java.io.InputStream is)
      Reads, scans, parses and compiles Java tokens from the given InputStream, encoded in the "platform default encoding".
      void cook​(java.io.InputStream is, java.lang.String encoding)
      Reads, scans, parses and compiles Java tokens from the given InputStream with the given encoding.
      void cook​(java.io.Reader r)
      Reads, scans, parses and compiles Java tokens from the given Reader.
      void cook​(java.lang.String s)
      Reads, scans, parses and compiles Java tokens from the given String.
      void cook​(java.lang.String fileName, java.io.InputStream is)
      Reads, scans, parses and compiles Java tokens from the given InputStream, encoded in the "platform default encoding".
      void cook​(java.lang.String fileName, java.io.InputStream is, java.lang.String encoding)
      Reads, scans, parses and compiles Java tokens from the given InputStream with the given encoding.
      void cook​(java.lang.String fileName, java.io.Reader r)
      Reads, scans, parses and compiles Java tokens from the given Reader.
      void cook​(java.lang.String fileName, java.lang.String s)
      Reads, scans, parses and compiles Java tokens from the given String.
      void cookFile​(java.io.File file)
      Reads, scans, parses and compiles Java tokens from the given File, encoded in the "platform default encoding".
      void cookFile​(java.io.File file, java.lang.String encoding)
      Reads, scans, parses and compiles Java tokens from the given File with the given encoding.
      void cookFile​(java.lang.String fileName)
      Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".
      void cookFile​(java.lang.String fileName, java.lang.String encoding)
      Reads, scans, parses and compiles Java tokens from the named file with the given encoding.
      java.util.Map<java.lang.String,​byte[]> getBytecodes()  
      void setSourceVersion​(int version)
      Specifies the version of source code accepted, in analogy with JAVAC's -source command line option.
      void setTargetVersion​(int version)
      Generates class files that target a specified release of the virtual machine, in analogy with JAVAC's -target command line option.
    • Method Detail

      • cook

        void cook​(@Nullable
                  java.lang.String fileName,
                  java.io.Reader r)
           throws CompileException,
                  java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given Reader.
        Parameters:
        fileName - Used when reporting errors and warnings
        Throws:
        CompileException
        java.io.IOException
      • cook

        void cook​(java.io.Reader r)
           throws CompileException,
                  java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given Reader.
        Throws:
        CompileException
        java.io.IOException
      • cook

        void cook​(java.io.InputStream is)
           throws CompileException,
                  java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given InputStream, encoded in the "platform default encoding".
        Throws:
        CompileException
        java.io.IOException
      • cook

        void cook​(@Nullable
                  java.lang.String fileName,
                  java.io.InputStream is)
           throws CompileException,
                  java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given InputStream, encoded in the "platform default encoding".
        Parameters:
        fileName - Used when reporting errors and warnings
        Throws:
        CompileException
        java.io.IOException
      • cook

        void cook​(java.io.InputStream is,
                  @Nullable
                  java.lang.String encoding)
           throws CompileException,
                  java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given InputStream with the given encoding.
        Throws:
        CompileException
        java.io.IOException
      • cook

        void cook​(@Nullable
                  java.lang.String fileName,
                  java.io.InputStream is,
                  @Nullable
                  java.lang.String encoding)
           throws CompileException,
                  java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given InputStream with the given encoding.
        Parameters:
        fileName - Used when reporting errors and warnings
        Throws:
        CompileException
        java.io.IOException
      • cook

        void cook​(@Nullable
                  java.lang.String fileName,
                  java.lang.String s)
           throws CompileException
        Reads, scans, parses and compiles Java tokens from the given String.
        Parameters:
        fileName - Used when reporting errors and warnings
        Throws:
        CompileException
      • cookFile

        void cookFile​(java.io.File file)
               throws CompileException,
                      java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given File, encoded in the "platform default encoding".
        Throws:
        CompileException
        java.io.IOException
      • cookFile

        void cookFile​(java.io.File file,
                      @Nullable
                      java.lang.String encoding)
               throws CompileException,
                      java.io.IOException
        Reads, scans, parses and compiles Java tokens from the given File with the given encoding.
        Throws:
        CompileException
        java.io.IOException
      • cookFile

        void cookFile​(java.lang.String fileName)
               throws CompileException,
                      java.io.IOException
        Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".
        Throws:
        CompileException
        java.io.IOException
      • cookFile

        void cookFile​(java.lang.String fileName,
                      @Nullable
                      java.lang.String encoding)
               throws CompileException,
                      java.io.IOException
        Reads, scans, parses and compiles Java tokens from the named file with the given encoding.
        Throws:
        CompileException
        java.io.IOException
      • setSourceVersion

        void setSourceVersion​(int version)
        Specifies the version of source code accepted, in analogy with JAVAC's -source command line option. May be ignored by an implementation (e.g. the janino implementation always accepts the language features as described on the home page). Allowed values, and the default value, depend on the implementation. -1 means to use a default version.
      • setTargetVersion

        void setTargetVersion​(int version)
        Generates class files that target a specified release of the virtual machine, in analogy with JAVAC's -target command line option. Allowed values depend on the implementation. The default value also depends on the implementation. The only invariant is that the generated class files are suitable for the currently executing JVM. -1 means to use a default version.
      • getBytecodes

        java.util.Map<java.lang.String,​byte[]> getBytecodes()
        Returns:
        The generated Java bytecode; maps class name to bytes
        Throws:
        java.lang.IllegalStateException - This IClassBodyEvaluator is not yet cooked