Interface ICookable

All Known Subinterfaces:
IClassBodyEvaluator, IExpressionEvaluator, IScriptEvaluator, ISimpleCompiler
All Known Implementing Classes:
ClassBodyEvaluator, ClassBodyEvaluator, Cookable, ExpressionEvaluator, ExpressionEvaluator, ScriptEvaluator, ScriptEvaluator, SimpleCompiler, SimpleCompiler

public interface ICookable
"Cooking" means scanning a sequence of characters and turning them into some JVM-executable artifact. For example, if you cook a ClassBodyEvaluator, then the tokens are interpreted as a class body and compiled into a Class which is accessible through IClassBodyEvaluator.getClazz().

The cook*() methods eventually invoke the abstract cook(String, Reader) method.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ClassLoader
    The ClassLoader that loads this classes on the boot class path, i.e.
    static final String
    Value 'org.codehaus.janino.source_debugging.dir'.
    static final String
    Value 'org.codehaus.janino.source_debugging.enable'.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Reads, scans, parses and compiles Java tokens from the given InputStream, encoded in the "platform default encoding".
    void
    cook(InputStream is, String optionalEncoding)
    Reads, scans, parses and compiles Java tokens from the given InputStream with the given encoding.
    void
    Reads, scans, parses and compiles Java tokens from the given Reader.
    void
    Reads, scans, parses and compiles Java tokens from the given String.
    void
    cook(String optionalFileName, InputStream is)
    Reads, scans, parses and compiles Java tokens from the given InputStream, encoded in the "platform default encoding".
    void
    cook(String optionalFileName, InputStream is, String optionalEncoding)
    Reads, scans, parses and compiles Java tokens from the given InputStream with the given encoding.
    void
    cook(String optionalFileName, Reader r)
    Reads, scans, parses and compiles Java tokens from the given Reader.
    void
    cook(String optionalFileName, String s)
    Reads, scans, parses and compiles Java tokens from the given String.
    void
    cookFile(File file)
    Reads, scans, parses and compiles Java tokens from the given File, encoded in the "platform default encoding".
    void
    cookFile(File file, String optionalEncoding)
    Reads, scans, parses and compiles Java tokens from the given File with the given encoding.
    void
    cookFile(String fileName)
    Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".
    void
    cookFile(String fileName, String optionalEncoding)
    Reads, scans, parses and compiles Java tokens from the named file with the given encoding.
    void
    setDebuggingInformation(boolean debugSource, boolean debugLines, boolean debugVars)
    Determines what kind of debugging information is included in the generates classes.
    void
    setParentClassLoader(ClassLoader optionalParentClassLoader)
    The "parent class loader" is used to load referenced classes.
  • Field Details

    • BOOT_CLASS_LOADER

      static final ClassLoader BOOT_CLASS_LOADER
      The ClassLoader that loads this classes on the boot class path, i.e. the JARs in the JRE's "lib" and "lib/ext" directories, but not the JARs and class directories specified through the class path.
    • SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE

      static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE
      Value 'org.codehaus.janino.source_debugging.enable'.

      Setting this system property to 'true' enables source-level debugging. Typically, this means that compilation is executed with '-g:all' instead of '-g:none'.

      See Also:
    • SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR

      static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR
      Value 'org.codehaus.janino.source_debugging.dir'.

      If source code is not compiled from a file, debuggers have a hard time locating the source file for source-level debugging. As a workaround, a copy of the source code is written to a temporary file, which must be included in the debugger's source path. If this system property is set, the temporary source file is created in that directory, otherwise in the default temporary-file directory.

      See Also:
  • Method Details