Examples of Import


Examples of anvil.script.Import

  public void importExternals(ErrorListener listener)
  {
    if (_imports != null) {
      int size = _imports.size();
      for(int i=0; i<size; i++) {
        Import imprt = (Import)_imports.get(i);
        Location location = imprt.getLocation();
        Object source = imprt.getSource();
        Name[] decls = imprt.getDeclarations();
        Type type = imprt.resolve(listener);
        if (type != null) {
          if (imprt.importAll()) {
            if (type instanceof Scope) {
              addExternals(listener, location, source, (Scope)type);
            } else {
              listener.error(location, "Trying to import all contained types from non-scoped entity '"+source+"'");
           
           
          } else if (decls != null) {
         
            if (type instanceof Scope) {
              int n = decls.length;
              for(int j=0; j<n; j++) {
                Name childname = decls[j];
                Type child = follow(type, childname);
                if (child != null) {
                  if (childname.hasStar()) {
                    switch(child.getType()) {
                    case MODULE:
                    case NAMESPACE:
                    case CLASS:
                    case INTERFACE:
                      addExternals(listener, location, source, (Scope)child);
                      break;
                    default:
                      listener.error(location, "Entity '"+child+"' does not contain any entities that may be imported");
                      break;
                    }
                  } else {
                    addExternal(listener, location, source, childname.as(), child);
                  }
                } else {
                  listener.error(location, "Entity '"+childname+"' not found from '"+source+"'");
                }
              }
             
            } else {
              listener.error(location, "Trying to import named entities from non-scoped entity '"+type+"'");
            }
         
          } else {
            addExternal(listener, location, source, imprt.getAs(), type);
          }
        }
      }
    }
    Enumeration e = _types.elements();
View Full Code Here

Examples of anvil.script.Import

      Name entity,
      Name[] decls,
      boolean withStar)
  {
    LinkNode link = new LinkNode(this, location, entity);
    Import imprt = new Import(null, location, entity, new TypeRef(link), entity.as(), decls, withStar);
    addImport(imprt);
  }
View Full Code Here

Examples of anvil.script.Import

      as = extractNameFromHref(address.getPathinfo());
    }
    if (!Grammar.isValidIdentifier(as)) {
      listener.error(location, "Identifier '" + as + "' is invalid");
    }      
    Import imprt = new Import(address, location, null,
        new ExternalTypeRef(script, address), as, decls, withStar);
    addImport(imprt);
  }
View Full Code Here

Examples of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.Import

    @Override
    public void processingInstruction(String target, String data)
        throws SAXException {
      if ("import".equals(target)) {
        Import i = FXGraphFactory.eINSTANCE.createImport();
        i.setImportedNamespace(data);
        model.getImports().add(i);
      } else if ("scenebuilder-stylesheet".equals(target)) {
        model.getComponentDef().getPreviewCssFiles().add(data);
      } else if ("scenebuilder-preview-i18n-resource".equals(target)) {
        model.getComponentDef().setPreviewResourceBundle(data);
View Full Code Here

Examples of com.asakusafw.compiler.flow.jobflow.JobflowModel.Import

            ExternalIoDescriptionProcessor proc = environment.getExternals().findProcessor(description);
            if (proc == null) {
                error("{0}は不明なインポーターを利用しています", desc);
                continue;
            }
            Import prologue = new Import(source, description, proc);
            LOG.debug("入力{}が追加されます", prologue);
            results.add(prologue);
        }
        Set<InputDescription> sideData = Sets.create();
        for (StageModel stage : stageModels) {
            sideData.addAll(stage.getSideDataInputs());
        }
        sideData.removeAll(saw);
        for (InputDescription input : sideData) {
            ExternalIoDescriptionProcessor proc = environment.getExternals().findProcessor(input);
            if (proc == null) {
                error("{0}は不明なインポーターを利用しています", input);
                continue;
            }
            Import prologue = new Import(input, proc);
            LOG.debug("サイドデータ入力{}が追加されます", prologue);
            results.add(prologue);
        }
        return results;
    }
View Full Code Here

Examples of com.asakusafw.compiler.flow.jobflow.JobflowModel.Import

        tester.framework().copy(compilerOutput, targetDirectory);
    }

    private void put(BatchInfo info, String name, String... values) {
        try {
            Import importer = tester.getImporter(info, name);
            ModelOutput<Simple> output = tester.openOutput(Simple.class, importer);
            try {
                Simple model = new Simple();
                for (String value : values) {
                    model.setValueAsString(value);
View Full Code Here

Examples of com.asakusafw.compiler.flow.jobflow.JobflowModel.Import

        assertThat(jobflow.getStages().size(), is(1));
        assertThat(jobflow.getImports().size(), is(1));
        assertThat(jobflow.getExports().size(), is(1));

        Import prologue = jobflow.getImports().get(0);
        assertThat(prologue.getDescription().getName(), is("ex1"));
        assertThat(
                prologue.getDescription().getImporterDescription().getClass(),
                is((Object) Ex1MockImporterDescription.class));

        Export epilogue = jobflow.getExports().get(0);
        assertThat(epilogue.getDescription().getName(), is("ex1"));
        assertThat(
View Full Code Here

Examples of com.asakusafw.compiler.flow.jobflow.JobflowModel.Import

        assertThat(jobflow.getStages().size(), is(1));
        assertThat(jobflow.getImports().size(), is(1));
        assertThat(jobflow.getExports().size(), is(1));

        Import prologue = jobflow.getImports().get(0);
        assertThat(prologue.getDescription().getName(), is("ex1"));
        assertThat(
                prologue.getDescription().getImporterDescription().getClass(),
                is((Object) Ex1MockImporterDescription.class));

        Export epilogue = jobflow.getExports().get(0);
        assertThat(epilogue.getDescription().getName(), is("exs"));
        assertThat(
View Full Code Here

Examples of com.asakusafw.compiler.flow.jobflow.JobflowModel.Import

        assertThat(jobflow.getStages().size(), is(2));
        assertThat(jobflow.getImports().size(), is(1));
        assertThat(jobflow.getExports().size(), is(1));

        Import prologue = jobflow.getImports().get(0);
        assertThat(prologue.getDescription().getName(), is("ex1"));
        assertThat(
                prologue.getDescription().getImporterDescription().getClass(),
                is((Object) Ex1MockImporterDescription.class));

        Export epilogue = jobflow.getExports().get(0);
        assertThat(epilogue.getDescription().getName(), is("ex1"));
        assertThat(
View Full Code Here

Examples of com.asakusafw.vocabulary.flow.Import

        Class<?>[] rawTypes = ctor.getParameterTypes();
        Type[] types = ctor.getGenericParameterTypes();
        Annotation[][] annotations = ctor.getParameterAnnotations();
        List<Parameter> results = Lists.create();
        for (int i = 0; i < types.length; i++) {
            Import importer = null;
            Export expoter = null;
            for (Annotation a : annotations[i]) {
                if (a.annotationType() == Import.class) {
                    importer = (Import) a;
                } else if (a.annotationType() == Export.class) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.