Examples of Specification


Examples of com.agilejava.maven.docbkx.spec.Specification

    InputStream in = loader.getResourceAsStream("plugins.stg");
    Reader reader = new InputStreamReader(in);
    StringTemplateGroup group = new StringTemplateGroup(reader);
    StringTemplate template = group.getInstanceOf("plugin");
    File targetFile = new File(sourcesDir, getClassName() + ".java");
    Specification specification = null;
    try {
      specification = createSpecification();
      getLog().info(
          "Number of parameters: "
              + specification.getParameters().size());
      template.setAttribute("spec", specification);
      FileUtils.writeStringToFile(targetFile, template.toString(), null);
    } catch (IOException ioe) {
      if (specification == null) {
        throw new MojoExecutionException("Failed to read parameters.",
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.model.Specification

    public void visit(Tree.SpecifierStatement that) {
        Tree.Term lhs = that.getBaseMemberExpression();
        if (lhs instanceof Tree.ParameterizedExpression) {
            ((Tree.ParameterizedExpression) lhs).setLeftTerm(true);
        }
        Specification s = new Specification();
        s.setId(id++);
        visitElement(that, s);
        Scope o = enterScope(s);
        super.visit(that);
        exitScope(o);
    }
View Full Code Here

Examples of fr.imag.adele.apam.Specification

    /*
     * First analyze the component references
     */
    if (relToResolve.getTarget() instanceof SpecificationReference) {
      Specification spec = CST.componentBroker.getSpec(name);
      if (spec == null) {
        return null;
      }
      if (relToResolve.getTargetKind() == ComponentKind.SPECIFICATION) {
        return new Resolved<Specification>(spec);
      }
      impls = spec.getImpls();
    } else if (relToResolve.getTarget() instanceof ImplementationReference) {
      Implementation impl = CST.componentBroker.getImpl(name);
      if (impl == null) {
        return null;
      }
      if (relToResolve.getTargetKind() == ComponentKind.IMPLEMENTATION) {
        return new Resolved<Implementation>(impl);
      }
      impls = new HashSet<Implementation>();
      impls.add(impl);
    } else if (relToResolve.getTarget() instanceof InstanceReference) {
      Instance inst = CST.componentBroker.getInst(name);
      if (inst == null) {
        return null;
      }
      if (relToResolve.getTargetKind() == ComponentKind.INSTANCE) {
        return new Resolved<Instance>(inst);
      }
      logger.debug("if (relToResolve.getTarget() instanceof InstanceReference) ") ;
      return null;
    } else if (relToResolve.getTarget() instanceof ComponentReference<?>) {
      logger.error("Invalid target reference : " + relToResolve.getTarget());
      return null;
    }

    /*
     * We have computed all component references It is either already
     * resolved, or the implems are in impls. Now Resolve by resource.
     */
    else if (relToResolve.getTarget() instanceof ResourceReference) {
      if (relToResolve.getTargetKind() == ComponentKind.SPECIFICATION) {
        Set<Specification> specs = new HashSet<Specification>();
        for (Specification spec : CST.componentBroker.getSpecs()) {
          if (spec.getProvidedResources().contains(relToResolve.getTarget())) {
            specs.add(spec);
          }
        }
        return relToResolve.getResolved(specs, false);
      }
View Full Code Here

Examples of fr.imag.adele.apam.Specification

      return null;
    }

    String specificationName = apfSpec.getDeclaration().getName();

    Specification specification = getSpec(specificationName);
    if (specification != null) {
      logger.error("Error adding specification: already exists " + specificationName);
      return specification;
    }
View Full Code Here

Examples of fr.imag.adele.apam.Specification

     * Reference the declared provided specification
     */
    if (declaration.getSpecification() != null) {

      String specificationName = declaration.getSpecification().getName();
      Specification specification = CST.componentBroker.getSpec(specificationName);

      assert specification != null;
      mySpec = specification;

    }
View Full Code Here

Examples of fr.imag.adele.apam.Specification

      }
      return;
  }

  String specificationName = args[0];
  Specification specification = CST.componentBroker
    .getSpec(specificationName);
  if (specification == null) {
      out.println("No such specification : " + specificationName);
      return;
  }
View Full Code Here

Examples of fr.imag.adele.apam.Specification

      }
      return;
  }

  String specificationName = args[0];
  Specification specification = CST.componentBroker
    .getSpec(specificationName);
  if (specification == null) {
      out.println("No such specification : " + specificationName);
      return;
  }
View Full Code Here

Examples of fr.imag.adele.apam.Specification

     * If a new specification is defined we need to try match existing services in the registry 
     */
    if (!(component instanceof Specification))
      return;
   
    Specification specification = (Specification) component;

    if (!isMatchable(specification))
      return;
   
    StringBuilder filter = new StringBuilder();
    filter.append("(").append("&");
    for (InterfaceReference providedInterface : specification.getDeclaration().getProvidedResources(InterfaceReference.class)) {
      filter.append("(").append(Constants.OBJECTCLASS).append("=").append(providedInterface.getName()).append(")");
    }
    filter.append(")");
   
    String filterText = filter.toString();
View Full Code Here

Examples of fr.imag.adele.apam.Specification

    /*
     * If a new specification is defined we need to try match existing factories in the registry 
     */
    if (component instanceof Specification) {

      Specification specification = (Specification) component;
      if (!isMatchable(specification))
        return;


      /*
 
View Full Code Here

Examples of fr.imag.adele.apam.Specification

     
    for (String providedResource : factory.getComponentDescription().getprovidedServiceSpecification()) {
      providedResources.add(new InterfaceReference(providedResource));
    }

    Specification best   = null;
    int bestScore    = 0;
   
    for (Specification specification : CST.componentBroker.getSpecs()) {
     
      int score = matchingScore(factory, specification);
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.