throws Exception
  private void encodeArrayAsObject(StringBuilderValue sb, ArrayValue val)  {      sb.append('{');      int length = 0;      for (Map.Entry<Value,Value> entry : val.entrySet()) {        if (length > 0)          sb.append(',');        jsonEncodeImpl(sb, entry.getKey().toStringValue());        sb.append(':');        jsonEncodeImpl(sb, entry.getValue());        length++;      }      sb.append('}');  }