Package aQute.libg.filters

Examples of aQute.libg.filters.Filter


        } else if (elem instanceof ProjectBundle) {
            bsn = ((ProjectBundle) elem).getBsn();
        }

        if (bsn != null) {
            Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, bsn);
            if (version != null) {
                filter = new AndFilter().addChild(filter).addChild(new SimpleFilter("version", Operator.GreaterThanOrEqual, version.toString()));
            }
            Requirement req = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement();
            return req;
        }
        return null;
    }
View Full Code Here


            if (Window.OK == dialog.open()) {
                List<VersionedClause> result = wizard.getSelectedBundles();
                List<Requirement> adding = new ArrayList<Requirement>(result.size());
                for (VersionedClause bundle : result) {
                    Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, bundle.getName());

                    String versionRange = bundle.getVersionRange();
                    if (versionRange != null && !"latest".equals(versionRange)) {
                        filter = new AndFilter().addChild(filter).addChild(new LiteralFilter(Filters.fromVersionRange(versionRange)));
                    }
                    Requirement req = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement();
                    adding.add(req);
                }
                if (!adding.isEmpty()) {
                    requires.addAll(adding);
                    viewer.add(adding.toArray(new Object[adding.size()]));
View Full Code Here

    String identity = entry.getKey();

    String versionStr = entry.getValue().get("version");

    // Construct a filter & requirement to find matches
    Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, identity);
    if (versionStr != null)
      filter = new AndFilter().addChild(filter).addChild(new LiteralFilter(Filters.fromVersionRange(versionStr)));
    Requirement frameworkReq = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(
        Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement();

    // Iterate over repos looking for matches
    for (Repository repo : repos) {
      Map<Requirement,Collection<Capability>> providers = repo.findProviders(Collections
          .singletonList(frameworkReq));
View Full Code Here

    String identity = entry.getKey();

    String versionStr = entry.getValue().getVersion();

    // Construct a filter & requirement to find matches
    Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, identity);
    if (versionStr != null)
      filter = new AndFilter().addChild(filter).addChild(new LiteralFilter(Filters.fromVersionRange(versionStr)));
    Requirement frameworkReq = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(
        Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement();
    return frameworkReq;
  }
View Full Code Here

    this.callbacks.addAll(callbacks);
  }

  public static Requirement createIdentityRequirement(String identity, String versionRange) {
    // Construct a filter & requirement to find matches
    Filter filter = new SimpleFilter(IdentityNamespace.IDENTITY_NAMESPACE, identity);
    if (versionRange != null)
      filter = new AndFilter().addChild(filter).addChild(
          new LiteralFilter(Filters.fromVersionRange(versionRange)));
    Requirement frameworkReq = new CapReqBuilder(IdentityNamespace.IDENTITY_NAMESPACE).addDirective(
        Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString()).buildSyntheticRequirement();
    return frameworkReq;
  }
View Full Code Here

TOP

Related Classes of aQute.libg.filters.Filter

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.