Subj : RE: Java Collection Support To : netscape.public.mozilla.jseng From : Rod Macpherson Date : Fri May 06 2005 09:58 am This is a multi-part message in MIME format. ------_=_NextPart_001_01C55254.6C78D1B2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Understood and we are doing that so let me clarify my question.=20 =20 I have the following in Java: =20 Map shapes =3D new HashMap(); =20 I put it in play as follows: =20 scope.put("shapes", scope, Context.toObject(shapes, scope)); =20 The problem is the, say, shape mapped to circle cannot be accessed as follows: =20 diameter =3D shapes.circle.diameter =20 I guess it's the syntax sugar I am looking for with collections.=20 =20 ________________________________ From: mozilla-jseng-admin@mozilla.org [mailto:mozilla-jseng-admin@mozilla.org] On Behalf Of Mark Turansky Sent: Friday, May 06, 2005 8:46 AM To: mozilla-jseng@mozilla.org Subject: Re: Java Collection Support =20 http://catb.org/~esr/jargon/html/R/RTFM.html =20 You can access any Java class through Rhino. Likewise, Java can access what was executed in your scripts. This is all covered in the documentation. "Rod Macpherson" wrote in message news:mailman.1115241788.27260.mozilla-jseng@mozilla.org... Apologies in advance if my original post shows up - not sure what the latency is on posts here. Anybody know whether rhino has or has plans to support native Java collections and maps? Alternatively is there an add-on package that supports this? Specifically would like to move Map or List types to and from Java and JavaScript.=20 =20 TIA ------_=_NextPart_001_01C55254.6C78D1B2 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Understood and we are doing that so = let me clarify my question.

 

I have the following in = Java:

 

Map<String, Shape> shapes =3D = new HashMap<String, Shape>();

 

I put it in play as = follows:

 

scope.put("shapes", = scope, Context.toObject(shapes, scope));

 

The problem is the, say, shape = mapped to circle cannot be accessed as follows:

 

diameter =3D = shapes.circle.diameter

 

I guess it’s the syntax sugar = I am looking for with collections.

 


From: mozilla-jseng-admin@mozilla.org [mailto:mozilla-jseng-admin@mozilla.org] = On Behalf Of Mark Turansky
Sent: Friday, May 06, = 2005 8:46 AM
To: = mozilla-jseng@mozilla.org
Subject: Re: Java = Collection Support

 

 

You can access any Java class through Rhino.  = Likewise, Java can access what was executed in your scripts.  This is all = covered in the documentation.

Apologies in advance if my original post shows up = – not sure what the latency is on posts here.  Anybody know whether = rhino has or has plans to support native Java collections and maps? = Alternatively is there an add-on package that supports this? Specifically would like to = move Map or List types to and from Java and JavaScript. =

 

TIA

------_=_NextPart_001_01C55254.6C78D1B2-- .