private Object readResolve() { VersionRange vr = this; if (equals(emptyRange)) vr = emptyRange; return vr; }
/** * Creates a query that will match any {@link IInstallableUnit} with the given * id, and whose version falls in the provided range. * * @param id The installable unit id to match, or <code>null</code> to match any id * @param range The version range to match or <code>null</code> to match any range. * @return a query that matches IU's by id and range */ public static IQuery<IInstallableUnit> createIUQuery(String id, VersionRange range) { if (range == null || range.equals(VersionRange.emptyRange)) return createIUQuery(id); if (id == null) return QueryUtil.createMatchQuery(matchIU_Range, range); return QueryUtil.createMatchQuery(matchIU_IDAndRange, id, range); }
public boolean matches(IRequiredCapability toMatch) { if (!toMatch.getNamespace().equals(applyOn.getNamespace())) return false; if (!toMatch.getName().equals(applyOn.getName())) return false; if (toMatch.getRange().equals(applyOn.getRange())) return true; return toMatch.getRange().intersect(applyOn.getRange()) != null; }
public static org.eclipse.osgi.service.resolver.VersionRange toOSGiVersionRange(VersionRange range) { if (range.equals(VersionRange.emptyRange)) return org.eclipse.osgi.service.resolver.VersionRange.emptyRange; return new org.eclipse.osgi.service.resolver.VersionRange(toOSGiVersion(range.getMinimum()), range.getIncludeMinimum(), toOSGiVersion(range.getMaximum()), range.getIncludeMinimum()); }
public static org.eclipse.osgi.service.resolver.VersionRange toOSGiVersionRange(VersionRange range) { if (range.equals(VersionRange.emptyRange)) return org.eclipse.osgi.service.resolver.VersionRange.emptyRange; return new org.eclipse.osgi.service.resolver.VersionRange(toOSGiVersion(range.getMinimum()), range.getIncludeMinimum(), toOSGiVersion(range.getMaximum()), range.getIncludeMinimum()); }
public static org.eclipse.osgi.service.resolver.VersionRange toOSGiVersionRange(VersionRange range) { if (range.equals(VersionRange.emptyRange)) { return org.eclipse.osgi.service.resolver.VersionRange.emptyRange; } return new org.eclipse.osgi.service.resolver.VersionRange(toOSGiVersion(range.getMinimum()), range.getIncludeMinimum(), toOSGiVersion(range.getMaximum()), range.getIncludeMinimum()); }
public static org.eclipse.osgi.service.resolver.VersionRange toOSGiVersionRange(VersionRange range) { if (range.equals(VersionRange.emptyRange)) return org.eclipse.osgi.service.resolver.VersionRange.emptyRange; return new org.eclipse.osgi.service.resolver.VersionRange(toOSGiVersion(range.getMinimum()), range.getIncludeMinimum(), toOSGiVersion(range.getMaximum()), range.getIncludeMinimum()); }
public RequiredCapability(String namespace, String name, VersionRange range, IMatchExpression<IInstallableUnit> filter, int min, int max, boolean greedy, String description) { Assert.isNotNull(namespace); Assert.isNotNull(name); IExpressionFactory factory = ExpressionUtil.getFactory(); if (range == null || range.equals(VersionRange.emptyRange)) { matchExpression = factory.matchExpression(allVersionsExpression, name, namespace); } else { if (range.getMinimum().equals(range.getMaximum())) { // Explicit version appointed matchExpression = factory.matchExpression(strictVersionExpression, name, namespace, range.getMinimum()); } else { if (range.getMaximum().equals(Version.MAX_VERSION)) { // Open ended matchExpression = factory.matchExpression(range.getIncludeMinimum() ? openEndedExpression : openEndedNonInclusiveExpression, name, namespace, range.getMinimum()); } else { matchExpression = factory.matchExpression(// range.getIncludeMinimum() ? (range.getIncludeMaximum() ? range_II_Expression : range_IN_Expression) // : (range.getIncludeMaximum() ? range_NI_Expression : range_NN_Expression), // name, namespace, range.getMinimum(), range.getMaximum()); } } } this.min = min; this.max = max; this.greedy = greedy; this.filter = filter; this.description = description; }
private static IMatchExpression<IInstallableUnit> createMatchExpressionFromRange(String namespace, String name, VersionRange range) { IMatchExpression<IInstallableUnit> resultExpression = null; IExpressionFactory factory = ExpressionUtil.getFactory(); if (range == null || range.equals(VersionRange.emptyRange)) { resultExpression = factory.matchExpression(allVersionsExpression, name, namespace); } else { if (range.getMinimum().equals(range.getMaximum())) { // Explicit version appointed resultExpression = factory.matchExpression(strictVersionExpression, name, namespace, range.getMinimum()); } else { if (range.getMaximum().equals(Version.MAX_VERSION)) { // Open ended resultExpression = factory.matchExpression(range.getIncludeMinimum() ? openEndedExpression : openEndedNonInclusiveExpression, name, namespace, range.getMinimum()); } else { resultExpression = factory.matchExpression(// range.getIncludeMinimum() ? (range.getIncludeMaximum() ? range_II_Expression : range_IN_Expression) // : (range.getIncludeMaximum() ? range_NI_Expression : range_NN_Expression), // name, namespace, range.getMinimum(), range.getMaximum()); } } } return resultExpression; }