title: How to use an ArrayList java object passed into the Rhino javascript engine?
body: <p>The following data:</p>
  
  <pre><code>sku=[111222]
  </code></pre>
  
  <p>is being passed in as an argument to a javascript function being invoked in the Rhino javascript engine.</p>
  
  <p>On the java side (where the data originates) this means that a String key of "sku" is mapped to an ArrayList with one String "111222" inside it.</p>
  
  <p>Once this goes over to the Rhino side, I have no idea how to make use of this as a javascript object. For example: How do I even do something as simple as fetching the 111222 value on the JS side?</p>
  
  <p>I decided to spit out what a key/value dump of this object looked like on the JS side and this is what I got:</p>
  
  <pre><code>sku=
  
  empty: false
  
  indexOf: function indexOf() {/*
  int indexOf(java.lang.Object)
  */}
  
  notifyAll: function notifyAll() {/*
  void notifyAll()
  */}
  
  removeAll: function removeAll() {/*
  boolean removeAll(java.util.Collection)
  */}
  
  trimToSize: function trimToSize() {/*
  void trimToSize()
  */}
  
  containsAll: function containsAll() {/*
  boolean containsAll(java.util.Collection)
  */}
  
  contains: function contains() {/*
  boolean contains(java.lang.Object)
  */}
  
  equals: function equals() {/*
  boolean equals(java.lang.Object)
  */}
  
  notify: function notify() {/*
  void notify()
  */}
  
  subList: function subList() {/*
  java.util.List subList(int,int)
  */}
  
  class: class java.util.ArrayList
  set: function set() {/*
  java.lang.Object set(int,java.lang.Object)
  */}
  
  isEmpty: function isEmpty() {/*
  boolean isEmpty()
  */}
  
  add: function add() {/*
  void add(int,java.lang.Object)
  boolean add(java.lang.Object)
  */}
  
  ensureCapacity: function ensureCapacity() {/*
  void ensureCapacity(int)
  */}
  
  size: function size() {/*
  int size()
  */}
  
  iterator: function iterator() {/*
  java.util.Iterator iterator()
  */}
  
  clear: function clear() {/*
  void clear()
  */}
  
  wait: function wait() {/*
  void wait()
  void wait(long)
  void wait(long,int)
  */}
  
  listIterator: function listIterator() {/*
  java.util.ListIterator listIterator(int)
  java.util.ListIterator listIterator()
  */}
  
  retainAll: function retainAll() {/*
  boolean retainAll(java.util.Collection)
  */}
  
  toString: function toString() {/*
  java.lang.String toString()
  */}
  
  hashCode: function hashCode() {/*
  int hashCode()
  */}
  
  toArray: function toArray() {/*
  java.lang.Object[] toArray(java.lang.Object[])
  java.lang.Object[] toArray()
  */}
  
  lastIndexOf: function lastIndexOf() {/*
  int lastIndexOf(java.lang.Object)
  */}
  
  addAll: function addAll() {/*
  boolean addAll(java.util.Collection)
  boolean addAll(int,java.util.Collection)
  */}
  
  clone: function clone() {/*
  java.lang.Object clone()
  */}
  
  get: function get() {/*
  java.lang.Object get(int)
  */}
  
  getClass: function getClass() {/*
  java.lang.Class getClass()
  */}
  
  remove: function remove() {/*
  java.lang.Object remove(int)
  boolean remove(java.lang.Object)
  */}
  </code></pre>
  
  <p>Can anyone tell me how to work with such objects in rhino javascript engine?</p>