scijava/scripting-java — pull request #3 by Squareys (2014-08-28 10:10:22+00:00)
Title: Compile(Reader) and Compile(String)

Hello @dscho, hello all!

I am currently working on a scripting node for KNIME and very happy to be able to use scijava and scripting-java.
Current goal is to execute one Command Plugin for every row in an input table.
This requires the Plugins Java code (as String) to be compiled once and then be reused for every row.

Until now there was no way to do this (except use eval(String) for the first row and the load the class manually to run the command on the following rows). Since there is an compile(File, Writer) already, I suggest adding compile(String) and compile(Reader) aswell.
I replaced the code which does the compilation in eval(Reader) with a call to the new compile(Reader) method.

Open for discussion:
- I set the return value of compile to Class. Other possibilities could be the name of the main class or void, analog to compile(File, Writer)
- Shouldn't compile(File, Writer) use getContext().getErrorWriter() ?
- I moved the class loader modification code to compile aswell ("needed for sezpoz?"), please pay special attention to whether that makes sense when reviewing.

What are your thoughts?

Greetings,
Jonathan