code: public static Object jsToJava(Object value, Class<?> desiredType)
          throws EvaluatorException
      {
          return NativeJavaObject.coerceTypeImpl(desiredType, value);
      }
docs: Convert a JavaScript value into the desired type.
  Uses the semantics defined with LiveConnect3 and throws an
  Illegal argument exception if the conversion cannot be performed.
  @param value the JavaScript value to convert
  @param desiredType the Java type to convert to. Primitive Java
  types are represented using the TYPE fields in the corresponding
  wrapper class in java.lang.
  @return the converted value
  @throws EvaluatorException if the conversion cannot be performed