Re: Scripting engine - Java 6



On Tue, 31 Jul 2007 11:19:00 -0000, debasish
<ghosh.debasish@xxxxxxxxx> wrote, quoted or indirectly quoted someone
who said :


Does this mean that if I want to stick to Sun's generifying layer,
I will be using classes like sun.org.mozilla.javascript.internal.NativeArray
for data type transformations between Javascript and Java ?
Or is there any other way of achieving the same goal.

Keep in mind, if you do that, you are cheating and defeating the
purpose of what Sun has done, so your code could break at any time.
Basically you get objects, find out their class with getClass, then
write code to cast them to specific objects so you can access the
native methods. You may find the methods you need in Sun's glue
objects are private to foil such attempts.

If I were you I would decide: do I want Sun generic scripting or
Rhino. Then, if Sun, stop cheating and use only the Sun API.. If
Rhino, bypass the Sun layer. Treat Rhino as if Sun had never heard of
it, downloading your own jar.

--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.



Relevant Pages