- return ((JSONReader) br).data;
- }
-
- /**
- * Get an object in the JSON associative array.
- * @param br
- * @param key
- * @return
- */
- @SuppressWarnings("unused")
- public static Object toObject(Object o) {
- if (o == null)
- return null;
- String type = /** @j2sNative (typeof o) + */"";
- switch (type) {
- case "string":
- return o;
- case "number":
- double n = 0;
- if (/** @j2sNative (n = o) == (n|0) || */false)
- return Long.valueOf((long) n);
- return Double.valueOf(n);
- case "boolean":
- return Boolean.valueOf(/** @j2sNative !!o || */false);
- case "object":
- boolean isArray = /** @j2sNative o instanceof Array || */false;
- if (isArray) {
- return toList((Object[]) o);
- }
- return toMap(o);
- default:
- return o;
- }
- }
-
- Object get(String key) {
- /**
- * @j2sNative
- *
- * return C$.toObject$O(this[key]);
- */
- {
- return null;
- }
- }
- boolean contains(String key) {
- /**
- * @j2sNative
- *
- * return typeof this[key] != "undefined"
- */
- {
- return false;
- }
- }
-
- @SuppressWarnings("unchecked")
- private static Hashtable<String, Object> toMap(Object map) {
- /**
- * @j2sNative
- * map.get$O = C$.prototype.get$S;
- * map.contains$O = C$.prototype.contains$S;
- */
- return (Hashtable<String, Object>) map;
- }
-
- private static List<Object> toList(Object[] a) {
- return new JSONList(a);