Java 类org.osgi.framework.VersionRange 实例源码

项目:osc-core    文件:RequirementParser.java   
private static String toBundleFilter(String bsn, String versionRangeStr) {
    final String filterStr;

    String bsnFilter = String.format("(%s=%s)", BundleNamespace.BUNDLE_NAMESPACE, bsn);

    if (versionRangeStr == null) {
        filterStr = bsnFilter;
    } else {
        VersionRange versionRange = new VersionRange(versionRangeStr);
        if (versionRange.isExact()) {
            String exactVersionFilter = String.format("(%s=%s)", BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE, versionRange.getLeft());
            filterStr = String.format("(&%s%s)", bsnFilter, exactVersionFilter);
        } else if (versionRange.getRight() == null) {
            filterStr = String.format("(&%s%s)", bsnFilter, lowerVersionFilter(versionRange));
        } else {
            filterStr = String.format("(&%s%s%s)", bsnFilter, lowerVersionFilter(versionRange), upperVersionFilter(versionRange));
        }
    }
    return filterStr;
}
项目:packagedrone    文件:InstallableUnit.java   
public Requirement ( final VersionRange range, final boolean optional, final Boolean greedy, final String filter )
{
    this.range = range;
    this.optional = optional;
    this.greedy = greedy;
    this.filter = filter;
}
项目:packagedrone    文件:InstallableUnit.java   
private String makeString ( final VersionRange range )
{
    if ( range == null )
    {
        return "0.0.0";
    }
    else
    {
        return range.toString ();
    }
}
项目:packagedrone    文件:FeatureInformation.java   
public VersionRange makeVersionRange ()
{
    if ( this.version == null )
    {
        return new VersionRange ( "0.0.0" );
    }
    else
    {
        return new VersionRange ( VersionRange.LEFT_CLOSED, this.version, this.version, VersionRange.RIGHT_CLOSED );
    }
}
项目:packagedrone    文件:FeatureInformation.java   
public VersionRange makeVersionRange ()
{
    if ( this.version == null )
    {
        return new VersionRange ( "0.0.0" );
    }
    else
    {
        return new VersionRange ( VersionRange.LEFT_CLOSED, this.version, this.version, VersionRange.RIGHT_CLOSED );
    }
}
项目:packagedrone    文件:BundleInformation.java   
public BundleRequirement ( final String id, final VersionRange versionRange, final boolean optional, final boolean reexport )
{
    this.id = id;
    this.versionRange = versionRange;
    this.optional = optional;
    this.reexport = reexport;
}
项目:tool.lars    文件:RepositoryResourceImpl.java   
/**
 * Check if this resources matches the supplied product definition
 *
 * @param def The product definition to check against
 * @return A {@link MatchResult} that says whether the resource matches the product definition, and if
 *         not the reason why the match failed.
 */
public MatchResult matches(ProductDefinition def) {
    Collection<AppliesToFilterInfo> atfiList = _asset.getWlpInformation().getAppliesToFilterInfo();
    if (atfiList == null || atfiList.isEmpty()) {
        return MatchResult.NOT_APPLICABLE;
    }
    MatchResult matchResult = MatchResult.MATCHED;
    for (AppliesToFilterInfo atfi : atfiList) {
        if (!!!atfi.getProductId().equals(def.getId())) {
            // This one isn't applicable, maybe the next one is
            matchResult = MatchResult.NOT_APPLICABLE;
            continue;
        } else {
            if (def.getVersion() != null && !def.getVersion().isEmpty()) {

                Version checkVersion = new Version(def.getVersion());
                VersionRange vr = FilterVersion.getFilterRange(atfi.getMinVersion(), atfi.getMaxVersion());

                if (!vr.includes(checkVersion)) {
                    return MatchResult.INVALID_VERSION;
                }
            }

            if (atfi.getRawEditions() != null && !!!atfi.getRawEditions().isEmpty() && !!!atfi.getRawEditions().contains(def.getEdition())) {
                return MatchResult.INVALID_EDITION;
            }

            if (atfi.getInstallType() != null && !!!atfi.getInstallType().equals(def.getInstallType())) {
                return MatchResult.INVALID_INSTALL_TYPE;
            }

            // Got here so this must have been a match, only need one of the array to match, not all
            return MatchResult.MATCHED;
        }
    }
    return matchResult;
}
项目:package-drone    文件:InstallableUnit.java   
public Requirement ( final VersionRange range, final boolean optional, final Boolean greedy, final String filter )
{
    this.range = range;
    this.optional = optional;
    this.greedy = greedy;
    this.filter = filter;
}
项目:package-drone    文件:InstallableUnit.java   
private String makeString ( final VersionRange range )
{
    if ( range == null )
    {
        return "0.0.0";
    }
    else
    {
        return range.toString ();
    }
}
项目:package-drone    文件:FeatureInformation.java   
public VersionRange makeVersionRange ()
{
    if ( this.version == null )
    {
        return new VersionRange ( "0.0.0" );
    }
    else
    {
        return new VersionRange ( VersionRange.LEFT_CLOSED, this.version, this.version, VersionRange.RIGHT_CLOSED );
    }
}
项目:package-drone    文件:FeatureInformation.java   
public VersionRange makeVersionRange ()
{
    if ( this.version == null )
    {
        return new VersionRange ( "0.0.0" );
    }
    else
    {
        return new VersionRange ( VersionRange.LEFT_CLOSED, this.version, this.version, VersionRange.RIGHT_CLOSED );
    }
}
项目:package-drone    文件:BundleInformation.java   
public BundleRequirement ( final String id, final VersionRange versionRange, final boolean optional, final boolean reexport )
{
    this.id = id;
    this.versionRange = versionRange;
    this.optional = optional;
    this.reexport = reexport;
}
项目:eclipse-license-management-tools    文件:LicenseKey.java   
public VersionRange getProductVersions() {
    String versions = getProperty(PRODUCT_VERSIONS);
    return (versions == null) ? null : VersionRange.valueOf(versions);
}
项目:eclipse-license-management-tools    文件:LicenseKey.java   
public boolean matchesProductVersion(String version) {
    VersionRange versions = getProductVersions();
    return (versions == null) ? true : versions
            .includes(new Version(version));
}
项目:packagedrone    文件:InstallableUnit.java   
public VersionRange getRange ()
{
    return this.range;
}
项目:packagedrone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( "0.0.0" );
}
项目:packagedrone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    final Version endVersion = new Version ( version.getMajor (), version.getMinor () + 1, 0 );
    return new VersionRange ( VersionRange.LEFT_CLOSED, version, endVersion, VersionRange.RIGHT_OPEN );
}
项目:packagedrone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    final Version endVersion = new Version ( version.getMajor () + 1, 0, 0 );
    return new VersionRange ( VersionRange.LEFT_CLOSED, version, endVersion, VersionRange.RIGHT_OPEN );
}
项目:packagedrone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( VersionRange.LEFT_CLOSED, version, version, VersionRange.RIGHT_CLOSED );
}
项目:packagedrone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( version.toString () );
}
项目:packagedrone    文件:BundleInformation.java   
public PackageImport ( final String name, final VersionRange versionRange, final boolean optional )
{
    this.name = name;
    this.versionRange = versionRange;
    this.optional = optional;
}
项目:packagedrone    文件:BundleInformation.java   
public VersionRange getVersionRange ()
{
    return this.versionRange;
}
项目:packagedrone    文件:BundleInformation.java   
public VersionRange getVersionRange ()
{
    return this.versionRange;
}
项目:package-drone    文件:InstallableUnit.java   
public VersionRange getRange ()
{
    return this.range;
}
项目:package-drone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( "0.0.0" );
}
项目:package-drone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    final Version endVersion = new Version ( version.getMajor (), version.getMinor () + 1, 0 );
    return new VersionRange ( VersionRange.LEFT_CLOSED, version, endVersion, VersionRange.RIGHT_OPEN );
}
项目:package-drone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    final Version endVersion = new Version ( version.getMajor () + 1, 0, 0 );
    return new VersionRange ( VersionRange.LEFT_CLOSED, version, endVersion, VersionRange.RIGHT_OPEN );
}
项目:package-drone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( VersionRange.LEFT_CLOSED, version, version, VersionRange.RIGHT_CLOSED );
}
项目:package-drone    文件:FeatureInformation.java   
@Override
public VersionRange makeRange ( final Version version )
{
    return new VersionRange ( version.toString () );
}
项目:package-drone    文件:BundleInformation.java   
public PackageImport ( final String name, final VersionRange versionRange, final boolean optional )
{
    this.name = name;
    this.versionRange = versionRange;
    this.optional = optional;
}
项目:package-drone    文件:BundleInformation.java   
public VersionRange getVersionRange ()
{
    return this.versionRange;
}
项目:package-drone    文件:BundleInformation.java   
public VersionRange getVersionRange ()
{
    return this.versionRange;
}
项目:packagedrone    文件:FeatureInformation.java   
public abstract VersionRange makeRange ( Version version );
项目:package-drone    文件:FeatureInformation.java   
public abstract VersionRange makeRange ( Version version );