« Return to Thread: Requesting new features

Re: Requesting new features

by Arno Unkrig :: Rate this Message:

Reply to Author | View in Thread

Hi Ilya,

Ilya Nedoluzhko schrieb:
...

> I anticipated that it is possible to use java-class source file "as is"
> without any additional external calls. It seems I can't just read and
> execute, I need to "setClassName". So, if I want to launch such code...
> ====================================
> package my.cool.package;
>
> public class My  {
>     // etc.
> }
>
> ====================================
> ...I have to cut first row, call setClassName() method and use generic
> procedure to launch code? It is not a problem, but why don't to do this
> inside Janino?

Now I got your point. Just call

     Reader r = new StringRead(
         "package my.cool.package; public class My { ... }"
     );
     Class c = new SimpleCompiler(null, r)
         .getClassLoader()
         .loadClass("my.cool.package.My");

That should do the job.

>
>         2) While it is crucial to keep library size small - I agree, it
>         is necessary to support new Java 5 features, such as templates,
>         foreach-style cycles and autoboxing. Especially the last ones,
>         because of importance in scripting.
>
>     I added this as a feature request to JIRA, see
>
> That's nice, but I think autoboxing isn't the only thing to care about.
> There a many other things that are very usefull. Anyway, it is better
> than nothing.

Feel free to post them on JIRA!


CU

Arno


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

 « Return to Thread: Requesting new features