title: Accessing java Maps & Lists as JavaScript Objects in Rhino
body: <p>Is there a way to access Java Maps and Lists as JavaScript Objects in Rhino?</p>
  
  <p>I have a Map which contains only other maps and lists of primitives and Strings, I'd like to pass this to a Rhino script and do stuff to it, and return the modified object back out to Java - but since they are java.util.Map and java.util.List Objects, I can't use standard JavaScript associative array syntax.
  ie: <code>fooMap.get("keyName")</code> will work, but <code>fooMap.keyName</code> and <code>fooMap["keyName"]</code> will not.</p>
  
  <p>I don't know if there is a Rhino-specific way to do this, or if there is some conversion/cast utility that will help.
  Commons BeanUtils is not sufficient, because to convert a Map to a bean (which can be accessed via associative array syntax), you must first create a class which has all of the named mutators/accessors.  I won't know the structure of the object at runtime.</p>