Package org.auraframework.def

Examples of org.auraframework.def.RootDefinition


    }
  }
 
  private <T extends Definition> void testLoadDocumentationDefViaRootDef(String qualifiedName, Class<T> defType, int noOfDescs)
      throws DefinitionNotFoundException, QuickFixException {
    RootDefinition c = (RootDefinition) Aura.getDefinitionService().getDefinition(qualifiedName, defType);
    DocumentationDef docDef = c.getDocumentationDef();
    assertNotNull("DocumentationDef not found!", docDef);
    assertEquals("Number DescriptionDefs don't match the expected value!", noOfDescs, docDef.getDescriptionDefs().size());
  }
View Full Code Here


    public Map<DefDescriptor<AttributeDef>, AttributeDefRef> getAttributeValues() {
        return attributeValues;
    }

    protected List<AttributeDefRef> getAttributeValueList() throws QuickFixException {
        RootDefinition def = getComponentDef();
        Collection<AttributeDef> defs = def.getAttributeDefs().values();
        List<AttributeDefRef> ret = Lists.newArrayList();
        for (AttributeDef at : defs) {
            AttributeDefRef ref = attributeValues.get(at.getDescriptor());
            if (ref != null) {
                ret.add(ref);
View Full Code Here

        }
    }

    @Override
    public void validateReferences() throws QuickFixException {
        RootDefinition rootDef = getComponentDef();
        if (rootDef == null) {
            throw new DefinitionNotFoundException(descriptor);
        }
       
        AuraContext context = Aura.getContextService().getCurrentContext();
View Full Code Here

     *
     * @param rootDef the element being instantiated
     * @param specifiedAttributes the attributes specified in the comp
     */
    private void validateAttributesValues(DefDescriptor<?> referencingDesc) throws QuickFixException, AttributeNotFoundException {
        RootDefinition rootDef = getComponentDef();
        Map<DefDescriptor<AttributeDef>, AttributeDef> atts = rootDef.getAttributeDefs();
        Map<String, RegisterEventDef> registeredEvents = rootDef.getRegisterEventDefs();
        MasterDefRegistry registry = Aura.getDefinitionService().getDefRegistry();
        for (Entry<DefDescriptor<AttributeDef>, AttributeDefRef> entry : getAttributeValues().entrySet()) {
            DefDescriptor<AttributeDef> attributeDefDesc = entry.getKey();
            AttributeDef attributeDef = atts.get(attributeDefDesc);
            if (attributeDef == null) {
                // didn't find an attribute by that name, check if there's an
                // event
                RegisterEventDef registeredEvent = registeredEvents.get(attributeDefDesc.getName());
                if (registeredEvent == null) {
                    throw new AttributeNotFoundException(rootDef.getDescriptor(), attributeDefDesc.getName(),
                            getLocation());
                }
               
              registry.assertAccess(referencingDesc, registeredEvent);
            } else {
View Full Code Here

                json.writeMapKey("attributes");

                json.writeMapBegin();
                json.writeMapKey("values");

                RootDefinition def = this.getComponentDef();
                json.writeMapBegin();
                for (Map.Entry<DefDescriptor<AttributeDef>, AttributeDefRef> entry : attributeValues.entrySet()) {
                    AttributeDef attributeDef = def.getAttributeDef(entry.getKey().getName());
                    if (attributeDef == null || attributeDef.getSerializeTo() != SerializeToType.SERVER) {
                        json.writeMapEntry(entry.getKey(), entry.getValue());
                    }
                }
                json.writeMapEnd();
View Full Code Here

        ReferenceTreeModel.assertAccess(definition);

        String type = null;
        if (definition instanceof RootDefinition) {
            RootDefinition rootDef = (RootDefinition) definition;
            for (AttributeDef attribute : rootDef.getAttributeDefs().values()) {
                if (ReferenceTreeModel.hasAccess(attribute)) {
                    attributes.add(new AttributeModel(attribute));
                }
            }

            DocumentationDef docDef = rootDef.getDocumentationDef();
            doc = docDef != null ? new DocumentationDefModel(docDef) : null;

            if (definition instanceof BaseComponentDef) {
                BaseComponentDef cmpDef = (BaseComponentDef) definition;
                for (RegisterEventDef reg : cmpDef.getRegisterEventDefs().values()) {
                    if (ReferenceTreeModel.hasAccess(reg)) {
                        events.add(new AttributeModel(reg));
                    }
                }

                for (EventHandlerDef handler : cmpDef.getHandlerDefs()) {
                    handledEvents.add(new AttributeModel(handler));
                }

                for (DefDescriptor<InterfaceDef> intf : cmpDef.getInterfaces()) {
                    if (ReferenceTreeModel.hasAccess(intf.getDef())) {
                        interfaces.add(intf.getNamespace() + ":" + intf.getName());
                    }
                }

                DefDescriptor<?> superDesc = cmpDef.getExtendsDescriptor();
                if (superDesc != null) {
                    theSuper = superDesc.getNamespace() + ":" + superDesc.getName();
                } else {
                    theSuper = null;
                }

                isAbstract = cmpDef.isAbstract();
                isExtensible = cmpDef.isExtensible();

            } else if (definition instanceof EventDef) {
                EventDef eventDef = (EventDef) definition;
                DefDescriptor<?> superDesc = eventDef.getExtendsDescriptor();
                if (superDesc != null) {
                    theSuper = superDesc.getNamespace() + ":" + superDesc.getName();
                } else {
                    theSuper = null;
                }

                type = eventDef.getEventType().name();
                isExtensible = true;
                isAbstract = false;
            } else if (definition instanceof LibraryDef) {
                theSuper = null;
                isExtensible = false;
                isAbstract = false;
            } else {
                theSuper = null;
                isExtensible = true;
                isAbstract = false;
            }

            support = rootDef.getSupport().name();

            if (definition instanceof RootDefinition) {
                List<DefDescriptor<?>> deps = ((RootDefinition) definition).getBundle();

                for (DefDescriptor<?> dep : deps) {
View Full Code Here

TOP

Related Classes of org.auraframework.def.RootDefinition

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.