Package org.auraframework.impl.expression

Examples of org.auraframework.impl.expression.PropertyReferenceImpl


    public ComponentConfig provide() throws QuickFixException {
        BaseComponent<?, ?> component = Aura.getContextService().getCurrentContext().getCurrentComponent();
        ComponentConfig cc = new ComponentConfig();
        Map<String, Object> m = Maps.newHashMapWithExpectedSize(1);
        // so now we're relying on the fact that the data provider's model has items on it, thats fantastic.
        m.put("items", component.getAttributes().getValue(new PropertyReferenceImpl("dataProvider.0.m.items", null)));
        cc.setAttributes(m);
        return cc;
    }
View Full Code Here


        for (DefDescriptor<AttributeDef> desc : attrs.keySet()) {
            Object val = lookup.get(desc);
            if (val != null) {
                if (val instanceof Attribute) {
                    Attribute attribute = (Attribute) val;
                    setExpression(attribute.getDescriptor(), new PropertyReferenceImpl("v." + attribute.getName(),
                            SUPER_PASSTHROUGH));
                } else if (val instanceof AttributeDefRef) {
                    set((AttributeDefRef) val);
                }
            }
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

                 
                  if (propRefs == null) {
                      propRefs = Sets.newHashSet();
                  }
                 
          propRefs.add(new PropertyReferenceImpl(labelRef, location));
                }
             
                result = raw;
            }
           
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

        bvp.validate(BrowserProperty.isIPad);
        bvp.validate(BrowserProperty.isIPhone);
        bvp.validate(BrowserProperty.isIOS);
        bvp.validate(BrowserProperty.isWindowsPhone);

        PropertyReference property = new PropertyReferenceImpl("hah", null);
        try {
            bvp.validate(property);
            fail("Expected InvalidExpressionException for " + property);
        } catch (InvalidExpressionException e) {
            assertEquals("No property on $Browser for key: " + property,
View Full Code Here

    }

    public void testGetValueUndefinedProperty() throws Exception {
        BrowserValueProvider bvp = new BrowserValueProvider();
        assertEquals(null,
                bvp.getValue(new PropertyReferenceImpl("isBlackberry", null))); // undefined property
    }
View Full Code Here

        LocaleValueProvider lvp = new LocaleValueProvider();
        for (LocaleProperty lp : LocaleProperty.values()) {
            lvp.validate(lp.getRef());
        }

        PropertyReference property = new PropertyReferenceImpl("badProperty", null);
        try {
            lvp.validate(property);
            fail("Expected InvalidExpressionException for " + property);
        } catch (InvalidExpressionException e) {
            assertEquals("No property on $Locale for key: " + property,
View Full Code Here

  public void testGetValueUndefinedProperty() throws Exception {
    AuraContext context = Aura.getContextService().getCurrentContext();
        context.setRequestedLocales(Arrays.asList(Locale.UK));
      LocaleValueProvider lvp = new LocaleValueProvider();
      assertEquals(null,
                lvp.getValue(new PropertyReferenceImpl("ISO3Language", null))); // undefined
                                                                                // property
    }
View Full Code Here

        assertEquals("Incorrect value returned from asValue()", testText[0], o.toString());

        tokenizer = TextTokenizer.tokenize(testText[1], null);
        o = tokenizer.asValue(cdh);
        assertTrue("Token value is of wrong type", o instanceof PropertyReferenceImpl);
        PropertyReferenceImpl e = (PropertyReferenceImpl) o;
        assertEquals("Incorrect value returned from asValue()", testText[1], e.toString(true));
    }
View Full Code Here

TOP

Related Classes of org.auraframework.impl.expression.PropertyReferenceImpl

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.