Package org.auraframework.expression

Examples of org.auraframework.expression.PropertyReference


        assertEquals(3, pr.size());
        List<String> l = pr.getList();
        assertEquals("test", l.get(0));
        assertEquals("yo", l.get(1));
        assertEquals("self", l.get(2));
        PropertyReference pr2 = pr.getStem();
        assertSame(loc, pr2.getLocation());
        assertEquals("root was not correct", "yo", pr2.getRoot());
        PropertyReference pr3 = pr2.getStem();
        assertSame(loc, pr3.getLocation());
        assertEquals("root was not correct", "self", pr3.getRoot());
        assertEquals(1, pr3.size());
    }
View Full Code Here


     */
    private static Object getValue(Object root, PropertyReference key, ModelDef def) throws QuickFixException {
        Object ret = null;
        try {
            String part = key.getRoot();
            PropertyReference stem = key.getStem();
            if (root == null) {
                return null;
            } else if (root instanceof Map) {
                ret = ((Map<?, ?>) root).get(part);
            } else if (root instanceof List) {
View Full Code Here

        try {
            String prefix = expr.getRoot();
            if ("c".equals(prefix)) {
                prefix.toString();
            }
            PropertyReference stem = expr.getStem();

            Object root = valueProviders.get(prefix);
            if (root == null) {
                ValueProviderType vpt = ValueProviderType.getTypeByPrefix(prefix);
                if (vpt != null) {
View Full Code Here

        }
    }

    @Override
    public Object getValue(String name) throws QuickFixException {
        PropertyReference expr = new PropertyReferenceImpl(name,
                AuraUtil.getExternalLocation("direct attributeset access"));
        if (expr.size() != 1) {
            throw new InvalidDefinitionException("No dots allowed", expr.getLocation());
        }
        return getValue(expr);
    }
View Full Code Here

    }

    @Override
    public Object getValue(PropertyReference expr) throws QuickFixException {
        Object value = getExpression(expr.getRoot());
        PropertyReference stem = expr.getStem();

        if (value instanceof Expression) {
            value = ((Expression) value).evaluate(valueProvider);
        }
        if (value instanceof ValueProvider && stem != null) {
View Full Code Here

        loggingService.stopTimer(LoggingService.TIMER_AURA);
        loggingService.startTimer("java");
        Object ret = null;
        try {
            String part = key.getRoot();
            PropertyReference stem = key.getStem();
            if (root == null) {
                return null;
            } else if (root instanceof Map) {
                ret = ((Map<?, ?>) root).get(part);
            } else if (root instanceof List) {
View Full Code Here

    @Override
    public Object getValue(PropertyReference key) throws QuickFixException {
        String root = key.getRoot();
        Object o = additionalValueProviders.get(root);
        if (o != null) {
            PropertyReference stem = key.getStem();
            if (stem != null) {
                if (o instanceof ValueProvider) {
                    return ((ValueProvider) o).getValue(stem);
                } else {
                    return JavaModel.getValue(o, stem, null);
View Full Code Here

                // validate that its a foreachs
            } else if (vpt.isGlobal()) {
                AuraContext lc = Aura.getContextService().getCurrentContext();
                GlobalValueProvider gvp = lc.getGlobalProviders().get(vpt);
                if (gvp != null) {
                    PropertyReference stem = e.getStem();
                    if (stem == null) {
                        throw new InvalidExpressionException("Expression didn't have enough terms: " + e, e.getLocation());
                    }
                    gvp.validate(stem);
                }
View Full Code Here

            if (!(expression instanceof PropertyReference)) {
                throw new AuraRuntimeException(
                        "Value of 'additionalAppCacheURLs' attribute must be a reference to a server Action");
            }

            PropertyReference ref = (PropertyReference) expression;
            ref = ref.getStem();

            ControllerDef controllerDef = getControllerDef();
            ActionDef actionDef = controllerDef.getSubDefinition(ref.toString());
            Action action = Aura.getInstanceService().getInstance(actionDef);

            AuraContext context = Aura.getContextService().getCurrentContext();
            Action previous = context.setCurrentAction(action);
            try {
View Full Code Here

    @AuraEnabled
    public static String getLabel(@Key("section") String section, @Key("name") String name) throws QuickFixException {
        GlobalValueProvider labelProvider = Aura.getContextService().getCurrentContext().getGlobalProviders()
                .get(LABEL);
        PropertyReference labelRef = new PropertyReferenceImpl(section + "." + name, null);
        return (String) labelProvider.getValue(labelRef);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.expression.PropertyReference

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.