Examples of VersionRange


Examples of cpw.mods.fml.common.versioning.VersionRange

    if (versionRangeString != null) {
      ModContainer mod = Loader.instance().getIndexedModList().get(modname);
      ArtifactVersion modVersion = mod.getProcessedVersion();

      VersionRange versionRange = VersionParser.parseRange(versionRangeString);
      DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(modname, versionRange);

      if (!requiredVersion.containsVersion(modVersion))
        return false;
    }
View Full Code Here

Examples of io.fabric8.agent.mvn.VersionRange

        final Set<DownloadableArtifact> downloadables = new TreeSet<DownloadableArtifact>(new DownloadComparator());

        // find artifact type
        final boolean isLatest = parser.getVersion().contains("LATEST");
        final boolean isSnapshot = parser.getVersion().endsWith("SNAPSHOT");
        VersionRange versionRange = null;
        if (!isLatest && !isSnapshot) {
            try {
                versionRange = new VersionRange(parser.getVersion());
            } catch (Exception ignore) {
                // well, we do not have a range of versions
            }
        }
        final boolean isVersionRange = versionRange != null;
View Full Code Here

Examples of org.apache.ace.util.VersionRange

         * Creates an endpoint filter for an association. If there is a KEY_ASSOCIATION_VERSIONSTATEMENT, a filter
         * will be created that matches exactly the given range.
         */
        if ((properties != null) && properties.containsKey(KEY_ASSOCIATION_VERSIONSTATEMENT)) {
            String versions = properties.get(KEY_ASSOCIATION_VERSIONSTATEMENT);
            VersionRange versionRange = null;
            try {
                versionRange = VersionRange.parse(versions);
            }
            catch (IllegalArgumentException iae) {
                throw new IllegalArgumentException("version " + ((versions != null) ? versions + " " : "(null) ") + "cannot be parsed into a valid version range statement.");
            }

            StringBuilder bundleStatement = new StringBuilder("(&(" + KEY_SYMBOLICNAME + "=" + RepositoryUtil.escapeFilterValue(obj.getAttribute(KEY_SYMBOLICNAME)) + ")");

            bundleStatement.append("(" + KEY_VERSION + ">=" + versionRange.getLow() + ")");
            if (!versionRange.isLowInclusive()) {
                bundleStatement.append("(!(" + KEY_VERSION + "=" + versionRange.getLow() + "))");
            }

            if (versionRange.getHigh() != null) {
                bundleStatement.append("(" + KEY_VERSION + "<=" + versionRange.getHigh() + ")");
                if (!versionRange.isHighInclusive()) {
                    bundleStatement.append("(!(" + KEY_VERSION + "=" + versionRange.getHigh() + "))");
                }
            }

            bundleStatement.append(")");

View Full Code Here

Examples of org.apache.aries.application.VersionRange

          || (Constants.BUNDLE_VERSION_ATTRIBUTE.equals(attribName))) {
        // version and bundle-version attrib requires special
        // conversion.
        realAttrib = true;

        VersionRange vr = ManifestHeaderProcessor
            .parseVersionRange(attrib.getValue());

        filter.append("(" + attribName + ">=" + vr.getMinimumVersion());

        if (vr.getMaximumVersion() != null) {
          filter.append(")(" + attribName + "<=");
          filter.append(vr.getMaximumVersion());
        }

        if (vr.getMaximumVersion() != null && vr.isMinimumExclusive()) {
          filter.append(")(!(" + attribName + "=");
          filter.append(vr.getMinimumVersion());
          filter.append(")");
        }

        if (vr.getMaximumVersion() != null && vr.isMaximumExclusive()) {
          filter.append(")(!(" + attribName + "=");
          filter.append(vr.getMaximumVersion());
          filter.append(")");
        }
        filter.append(")");

      } else if (NESTED_FILTER_ATTRIBUTE.equals(attribName)) {
View Full Code Here

Examples of org.apache.aries.util.VersionRange

        }
      }
    }
    //If we have too many provider class names or incompatible version ranges specified then blow up
   
    VersionRange range = null;
    if(!!!versionRanges.isEmpty()) {
      try {
        range = combineVersionRanges(versionRanges);
      } catch (InvalidRangeCombination e) {
        Bundle bundle = parsedPersistenceUnits.iterator().next().getDefiningBundle();
View Full Code Here

Examples of org.apache.felix.framework.util.VersionRange

     * @param versionRange the target version range.
     * @return an array of matching bundles sorted in descending version order.
    **/
    public Bundle[] getBundles(String symbolicName, String versionRange)
    {
        VersionRange vr = (versionRange == null) ? null : VersionRange.parse(versionRange);
        Bundle[] bundles = m_felix.getBundles();
        List list = new ArrayList();
        for (int i = 0; (bundles != null) && (i < bundles.length); i++)
        {
            String sym = bundles[i].getSymbolicName();
            if ((sym != null) && sym.equals(symbolicName))
            {
                Version v = bundles[i].adapt(BundleRevision.class).getVersion();
                if ((vr == null) || vr.isInRange(v))
                {
                    list.add(bundles[i]);
                }
            }
        }
View Full Code Here

Examples of org.apache.felix.framework.util.VersionRange

        for (Entry<String, Object> entry : attrs.entrySet())
        {
            if (entry.getValue() instanceof VersionRange)
            {
                VersionRange vr = (VersionRange) entry.getValue();
                if (vr.isFloorInclusive())
                {
                    filters.add(
                        new SimpleFilter(
                            entry.getKey(),
                            vr.getFloor().toString(),
                            SimpleFilter.GTE));
                }
                else
                {
                    SimpleFilter not =
                        new SimpleFilter(null, new ArrayList(), SimpleFilter.NOT);
                    ((List) not.getValue()).add(
                        new SimpleFilter(
                            entry.getKey(),
                            vr.getFloor().toString(),
                            SimpleFilter.LTE));
                    filters.add(not);
                }

                if (vr.getCeiling() != null)
                {
                    if (vr.isCeilingInclusive())
                    {
                        filters.add(
                            new SimpleFilter(
                                entry.getKey(),
                                vr.getCeiling().toString(),
                                SimpleFilter.LTE));
                    }
                    else
                    {
                        SimpleFilter not =
                            new SimpleFilter(null, new ArrayList(), SimpleFilter.NOT);
                        ((List) not.getValue()).add(
                            new SimpleFilter(
                                entry.getKey(),
                                vr.getCeiling().toString(),
                                SimpleFilter.GTE));
                        filters.add(not);
                    }
                }
            }
View Full Code Here

Examples of org.apache.felix.framework.util.VersionRange

            {
                // no specific version required, this export surely satisfies it
                return true;
            }

            VersionRange required = VersionRange.parse( versionAttr );
            return required.isInRange( exported.getVersion() );
        }

        // no this export does not satisfy the import
        return false;
    }
View Full Code Here

Examples of org.apache.felix.karaf.commons.osgi.VersionRange

                for (HeaderParser.PathElement pe : exports) {
                    if (pi.getName().equals(pe.getName())) {
                        String evStr = pe.getAttribute(Constants.VERSION_ATTRIBUTE);
                        String ivStr = pi.getAttribute(Constants.VERSION_ATTRIBUTE);
                        Version exported = evStr != null ? Version.parseVersion(evStr) : Version.emptyVersion;
                        VersionRange imported = ivStr != null ? VersionRange.parse(ivStr) : VersionRange.infiniteRange;
                        if (imported.isInRange(exported)) {
                            matching = true;
                            break;
                        }
                    }
                }
View Full Code Here

Examples of org.apache.felix.sigil.common.osgi.VersionRange

                        Version version = dialog.getVersion();
                        if (version == null)
                        {
                            version = getBundle().getVersion();
                        }
                        VersionRange versionRange = ModelHelper.getDefaultRange(version);
                        pkgImport.setVersions(versionRange);

                        getBundle().getBundleInfo().addImport(pkgImport);

                        importsAdded = true;
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.