see WrapFactory You can have your own instance that you set in the context there you can wrap/convert everything from java to js.
Dont know if there is a way the other way around (a JS Array to a List) On Wed, Jul 7, 2010 at 09:50, Daniel Winterstein <[email protected]> wrote: > > Is it possible to configure Rhino to do automatic conversion or wrapping > between Java types and Javascript equivalents? > > In particular, I'd like to use javascript to call a Java method which > returns a List. And have that List be mapped to a Javascript array. > > I understand why this isn't the normal behaviour, but it can be very useful > in places. Is there a way to get this behaviour? > > This is probably an old question, but I couldn't find the answer in > documentation or archives. > > Background: Our software allows users to write scripts in Javascript, > executed using Rhino. These scripts are accessing Java objects. Our users > expect lists to behave like Javascript arrays. Which leads to bugs, > confusion, distress, etc. > > Thank you in advance for any help. > > Best regards, > Daniel > > -------------------------------------------- > Dr Daniel Winterstein > Winterwell Associates Ltd > tel: 0772 5172 612 > http://www.winterwell.com > Registered in Scotland, company no. SC342991 > > > _______________________________________________ > dev-tech-js-engine-rhino mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino > _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
