public Object toJava()

in boot-script/src/main/java/net/java/html/boot/script/ScriptPresenter.java [274:302]


    public Object toJava(Object toJS) {
        if (toJS == undefined || toJS == null) {
            return null;
        }
        if (toJS instanceof String || toJS instanceof Number || toJS instanceof Boolean || toJS instanceof Character) {
            return toJS;
        }
        jsReady.add(toJS.getClass());
        try {
            callback.last = this;
            extractJavaObject().invokeImpl(null, false, toJS);
            if (callback.last != this) {
                toJS = callback.last;
            }
        } catch (Exception ex) {
            throw new IllegalStateException(ex);
        }
        if (toJS instanceof Weak) {
            toJS = ((Weak)toJS).get();
        }
        if (toJS == undefined || toJS == null) {
            return null;
        }
        try {
            return checkArray(toJS);
        } catch (Exception ex) {
            throw new IllegalStateException(ex);
        }
    }