Package org.auraframework.def

Examples of org.auraframework.def.TypeDef


                }
            }
            if (stem != null) {
                if (def != null) {
                    ValueProvider vp;
                    TypeDef typeDef = def.getType(part);
                    vp = (ret instanceof ValueProvider) ? (ValueProvider) ret : (ValueProvider) typeDef.wrap(ret);
                    ret = vp.getValue(stem);
                } else {
                    getValue(ret, stem, def);
                }
            }
View Full Code Here


                    if (attributeDef == null) {
                        throw new AttributeNotFoundException(rootDefDescriptor, name, def.getLocation());
                    }

                    if (attributeDef.getSerializeTo() == AttributeDef.SerializeToType.BOTH) {
                        TypeDef typeDef = attributeDef.getTypeDef();
                        if ((valueProvider == null && !((typeDef instanceof ComponentArrayTypeDef) || (typeDef instanceof ComponentTypeDef)))
                                || attribute.isDirty()) {
                            json.writeMapEntry(name, attribute.getValue());
                        }
                    }
View Full Code Here

    }

    @Override
    public void validateReferences() throws QuickFixException {
        try {
            TypeDef typeDef = typeDefDescriptor.getDef();
            if (defaultValue != null) {
                defaultValue.parseValue(typeDef);
                defaultValue.validateReferences();

            }
View Full Code Here

     */
    @Override
    public Object getExternalType(String prefix) throws QuickFixException {
        prefix = prefix.toLowerCase();
        if (!prefix.equals("java")) {
            TypeDef typeDef = DefDescriptorImpl.getAssociateDescriptor(descriptor, TypeDef.class, prefix).getDef();
            if (typeDef != null) {
                return typeDef.getExternalType(prefix);
            }
        }
        return clazz;
    }
View Full Code Here

    }

    private static <E extends Definition> DefDescriptor<E> buildInstance(String qualifiedName,
            Class<E> defClass, DefDescriptor<?> bundle) {
        if (defClass == TypeDef.class && qualifiedName.indexOf("://") == -1) {
            TypeDef typeDef = AuraStaticTypeDefRegistry.INSTANCE.getDef(qualifiedName);
            if (typeDef != null) {
                @SuppressWarnings("unchecked")
                DefDescriptor<E> result = (DefDescriptor<E>) typeDef.getDescriptor();
                return result;
            }
        }

        return new DefDescriptorImpl<>(qualifiedName, defClass, bundle);
View Full Code Here

        assertTrue(bundleDescs.contains(controllerDesc));

        // finding java definitions
        DefDescriptor<TypeDef> javaDescriptor = definitionService.getDefDescriptor(
                "java://org.auraframework.impl.java.controller.TestController", TypeDef.class);
        TypeDef javaDef = javaDescriptor.getDef();
        assertEquals("TestController", javaDef.getName());
    }
View Full Code Here

    public DefDescriptor<TypeDef> getTypeDefDescriptor() {
        return DefDescriptorImpl.getInstance("String", TypeDef.class);
    }

    public TypeDef getTypeDef() {
        return new TypeDef() {

            private static final long serialVersionUID = -245212961854034916L;

            @Override
            public void appendDependencies(Set<DefDescriptor<?>> dependencies) {
View Full Code Here

        SerializeToType actual = buildDefinition().getSerializeTo();
        assertEquals(this.serializeTo, actual);
    }

    public void testGetTypeDef() throws Exception {
        TypeDef expected = Mockito.mock(TypeDef.class);
        Mockito.doReturn(expected).when(this.typeDefDescriptor).getDef();
        TypeDef actual = buildDefinition().getTypeDef();
        assertEquals(expected, actual);
    }
View Full Code Here

                    "Cannot set an attribute as required and private");
        }
    }

    public void testValidateReferencesDefaultValue() throws Exception {
        TypeDef typeDef = Mockito.mock(TypeDef.class);
        Mockito.doReturn(typeDef).when(this.typeDefDescriptor).getDef();
        AttributeDef attributeDef = buildDefinition();
        Mockito.verifyZeroInteractions(this.defaultValue);
        attributeDef.validateReferences();
        Mockito.verify(this.defaultValue).parseValue(typeDef);
View Full Code Here

     */
    public void testParseValueSimple() throws Exception {
        AuraContext context = Aura.getContextService().getCurrentContext();
        String typeName = getAuraTestingUtil().getNonce("customType");
        DefDescriptor<TypeDef> typeDesc = DefDescriptorImpl.getInstance(typeName, TypeDef.class);
        TypeDef mockType = Mockito.mock(TypeDef.class);
        Mockito.doReturn(typeDesc).when(mockType).getDescriptor();
        Mockito.doReturn("fabulous").when(mockType).valueOf("parseable");
        context.getDefRegistry().addLocalDef(mockType);
        AttributeDefRefImpl adr = assertParsedValue("parseable", typeName, "fabulous");
        assertEquals("unparsed for toString()", "parseable", adr.toString());
View Full Code Here

TOP

Related Classes of org.auraframework.def.TypeDef

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.