Package org.auraframework.def

Examples of org.auraframework.def.Definition


        //
        descriptors = mdr.find(root_nsf);
        // HACK! this should go away with: W-2368045
        descriptors.add(Aura.getDefinitionService().getDefDescriptor("markup://"+namespace, NamespaceDef.class));
        for (DefDescriptor<?> desc : descriptors) {
            Definition def = null;
            try {
                def = mdr.getDef(desc);
                if (def == null) {
                    logger.error("Unable to find "+desc+"@"+desc.getDefType());
                    error = true;
                }
            } catch (QuickFixException qfe) {
                logger.error(qfe);
                error = true;
            }
        }
        //
        // Now filter the compiled set on the namespace.
        //
        Set<DefDescriptor<?>> empty = Sets.newHashSet();
        filtered = mdr.filterRegistry(empty);
        logger.debug("******************************************* "+namespace+" ******************************");
        for (Map.Entry<DefDescriptor<?>,Definition> entry : filtered.entrySet()) {
            DefDescriptor<?> desc = entry.getKey();
            Definition def = entry.getValue();
            // We ignore null here as we don't care about dead ends during compile.
            if (namespace.equals(desc.getNamespace()) && def != null) {
                logger.debug("ENTRY: "+desc+"@"+desc.getDefType().toString());
                types.add(desc.getDefType());
                prefixes.add(desc.getPrefix());
View Full Code Here


   
  protected void runTestCase() throws Exception{
    try{                                 
      DefDescriptor<? extends Definition> descriptor = getAuraTestingUtil().addSourceAutoCleanup(getDefClass(), getResourceSource(), getDefDescriptorName(), (testNamespace == TestNamespace.System? true: false));
      Source<? extends Definition> source = StringSourceLoader.getInstance().getSource(descriptor);     
      Definition def = parser.parse(descriptor, source);
      def.validateDefinition();     
     
      if(!isValidTestCase()) {
        fail("Should have thrown Exception for access: " + getAccess());
      }
    }
View Full Code Here

    String uid;

    this.error = true;
    this.items = Lists.newArrayList();
    try {
      Definition def = Aura.getDefinitionService().getDefinition(cmpname,
          DefType.COMPONENT, DefType.APPLICATION);
      if (def == null) {
        this.title = "Unable to find component for input "
            + AuraTextUtil.escapeForHTML(cmpname);
        return;
      }
      descriptor = def.getDescriptor();
      uid = mdr.getUid(null, descriptor);
      sorted = Sets.newTreeSet(mdr.getDependencies(uid));
      this.title = String.format("Dependencies for %s [uid=%s]",
          descriptor.toString(), uid);
      this.error = false;
    } catch (Throwable t) {
      // If we get an exception, try to tell the user what happened.
      this.title = String.format(
          "%s: %s : list of reached components...",
          AuraTextUtil.escapeForHTML(cmpname), t.getMessage());
      sorted = Sets.newTreeSet(mdr.filterRegistry(null).keySet());
    }
   
    try {
      for (DefDescriptor<?> dep : sorted) {
        Map<String, Object> itemData = Maps.newHashMap();
        Definition def = mdr.getDef(dep);
        boolean valid = false;
        String hash = "------";

        if (def != null) {
          valid = def.isValid();
          hash = String.valueOf(def.getOwnHash());
        }
       
        itemData.put("descriptor", dep.toString());
        itemData.put("type", dep.getDefType());
        itemData.put("uid", hash);
View Full Code Here

                    case COMPONENT:
                    case APPLICATION:
                    case INTERFACE:

                        try {
                            Definition definition = descriptor.getDef();

                            if (definition instanceof RootDefinition) {
                                List<DefDescriptor<?>> deps = ((RootDefinition) definition).getBundle();
                                ValidationEngine validationEngine = new ValidationEngine();
                                for (DefDescriptor<?> dep : deps) {
View Full Code Here

    @Override
    public void appendDependencies(Set<DefDescriptor<?>> dependencies) {
        Object v = this.getValue();
        if (v instanceof Definition) {
            Definition def = (Definition) v;
            def.appendDependencies(dependencies);
        } else if (v instanceof Collection) {
            Collection<?> col = (Collection<?>) v;
            for (Object obj : col) {
                if (obj instanceof Definition) {
                    Definition def = (Definition) obj;
                    def.appendDependencies(dependencies);
                }
            }
        }
    }
View Full Code Here

        Set<DefDescriptor<?>> includedDescriptors = new HashSet<DefDescriptor<?>>();

        // add bundle ones from RootDefinition elements
        Set<DefDescriptor<?>> bundlesDescriptors = new HashSet<DefDescriptor<?>>();
        for (DefDescriptor<?> descriptor : descriptors) {
            Definition definition = null;
            try {
                definition = descriptor.getDef();
            } catch (Exception ex) {
                LOG.warn("exception loading " + descriptor, ex);
            }
View Full Code Here

        }

        try {
            List<ClientLibraryDef> clientLibs = Lists.newArrayList();
            CompileContext cc = new CompileContext(descriptor, clientLibs);
            Definition def = compileDef(descriptor, cc);
            DependencyEntry de;
            String uid;

            if (def == null) {
                return null;
View Full Code Here

        }

        DefDescriptor<?> desc = null;
        for (DefType defType : defTypes) {
            desc = getDefDescriptor(qualifiedName, defType.getPrimaryInterface());
            Definition ret = null;
            try {
                ret = desc.getDef();
            } catch (DefinitionNotFoundException e) {
                // ignore
            }
View Full Code Here

                    List<Definition> libraryDefs = Lists.newArrayList();

                    for (Map.Entry<DefDescriptor<? extends Definition>, Definition> entry : defMap.entrySet()) {
                        DefDescriptor<? extends Definition> desc = entry.getKey();
                        DefType dt = desc.getDefType();
                        Definition d = entry.getValue();
                        //
                        // Ignore defs that ended up not being valid. This is arguably something
                        // that the MDR should have done when filtering.
                        //
                        if (d != null) {
View Full Code Here

                .getAssociateDescriptor(suiteDescriptor, ComponentDef.class,
                        DefDescriptor.MARKUP_PREFIX);
        List<Definition> building = Lists.newArrayList();
        if (mocks != null && !mocks.isEmpty()) {
            for (Object mock : mocks) {
                @SuppressWarnings("unchecked")
                Definition mockDef = parseMock(compDesc, (Map<String, Object>) mock);
                if (mockDef != null) {
                    building.add(mockDef);
                }
            }
View Full Code Here

TOP

Related Classes of org.auraframework.def.Definition

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.