Package org.auraframework.util.json

Examples of org.auraframework.util.json.JsFunction


        }
    }

    @Override
    public JsFunction getDefaultHandler() {
        return new JsFunction(ImmutableList.<String> of(),
                "try{$A.clientService.setOutdated()}catch(e){$L.clientService.setOutdated()}");
    }
View Full Code Here


        }
    }

    @Override
    public JsFunction getDefaultHandler() {
        return new JsFunction(ImmutableList.<String> of(),
                "try{$A.clientService.hardRefresh();}catch(e){$L.clientService.hardRefresh();}");
    }
View Full Code Here

        }
    }

    @Override
    public JsFunction getDefaultHandler() {
        return new JsFunction(ImmutableList.<String> of(), "$A.error('unknown error');");
    }
View Full Code Here

    }

    @Override
    public JsFunction getDefaultHandler() {
        if (this.redirectURL != null) {
            return new JsFunction(ImmutableList.<String> of(), String.format("window.location = '%s';", redirectURL));
        } else {
            return new JsFunction(ImmutableList.<String> of(), "$A.clientService.hardRefresh()");
        }
    }
View Full Code Here

        }
    }

    @Override
    public JsFunction getDefaultHandler() {
        return new JsFunction(ImmutableList.<String> of(), "$A.error('Unable to process event');");
    }
View Full Code Here

        String contents = "function(){" + source.getContents() + "\n}";
        String code = null;
        in = new JsonStreamReader(new StringReader(contents), getHandlerProvider());
        try {
            in.next();
            JsFunction function = (JsFunction) in.getValue();
            code = function.getBody();
        } catch (JsonParseException pe) {
            // EVIL: JsonStreamReader doesn't handle js regex during parse, so we can end up here unexpectedly
            // TODO: will have to find better impl to sanitize and validate library content
            // until then, at least strip out multi-line comments
            code = source.getContents();
View Full Code Here

    @Override
    protected JavascriptControllerDef createDefinition(Map<String, Object> map) {
        setDefBuilderFields(builder);
        builder.actionDefs = Maps.newTreeMap();
        for (Map.Entry<String, Object> e : map.entrySet()) {
            JsFunction f = (JsFunction) e.getValue();
            String name = e.getKey();
            JavascriptActionDef action = createActionDef(name, f);
            builder.actionDefs.put(name, action);
        }
        return builder.build();
View Full Code Here

        return includeDescriptor;
    }

    @Override
    public void serialize(Json json) throws IOException {
        JsFunction function = new JsFunction(Arrays.asList("define"), prepareCode());
        json.writeValue(function);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.util.json.JsFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.