HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2015-01-14 bc14a311332ccabcfe0d05ea064d322281232d5b
fix handling of java-arrays
1 files modified
37 ■■■■■ changed files
hsarjcli/resource/js/functions.js 37 ●●●●● patch | view | raw | blame | history
hsarjcli/resource/js/functions.js
@@ -1,3 +1,4 @@
importClass(java.util.Arrays);
importClass(java.util.ArrayList);
importClass(java.util.HashMap);
@@ -51,21 +52,31 @@
}
function hsaToNativeJSObject(val) {
    if (val instanceof java.util.List) {
        var res = [];
        for (var i = 0; i < val.size(); i++) {
            res[i] = hsaToNativeJSObject(val.get(i));
    if (val instanceof java.lang.Object) {
        if (val instanceof java.util.List) {
            var res = [];
            for (var i = 0; i < val.size(); i++) {
                res[i] = hsaToNativeJSObject(val.get(i));
            }
            return res;
        }
        return res;
    }
    if (val instanceof java.util.Map) {
        var res = {};
        var iter = val.keySet().iterator();
        while (iter.hasNext()) {
            var key = iter.next();
            res[key] = hsaToNativeJSObject(val.get(key));
        if (val instanceof java.util.Map) {
            var res = {};
            var iter = val.keySet().iterator();
            while (iter.hasNext()) {
                var key = iter.next();
                res[key] = hsaToNativeJSObject(val.get(key));
            }
            return res;
        }
        return res;
        var classSimpleName = val.getClass().getSimpleName();
        if (classSimpleName == 'Object[]') {
            var res = [];
            for (var i = 0; i < val.length; i++) {
                res[i] = hsaToNativeJSObject(val[i]);
            }
            return res;
        }
    }
    return val;
}