當前位置: 首頁>>代碼示例>>Java>>正文


Java VersionRange.hasRestrictions方法代碼示例

本文整理匯總了Java中org.apache.maven.artifact.versioning.VersionRange.hasRestrictions方法的典型用法代碼示例。如果您正苦於以下問題:Java VersionRange.hasRestrictions方法的具體用法?Java VersionRange.hasRestrictions怎麽用?Java VersionRange.hasRestrictions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.artifact.versioning.VersionRange的用法示例。


在下文中一共展示了VersionRange.hasRestrictions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isVersionOverlap

import org.apache.maven.artifact.versioning.VersionRange; //導入方法依賴的package包/類
/**
 * Checks if two versions or ranges have an overlap.
 *
 * @param leftVersionOrRange the 1st version number or range to test
 * @param rightVersionOrRange the 2nd version number or range to test
 * @return true if both versions have an overlap
 * @throws InvalidVersionSpecificationException if the versions can't be parsed to a range
 */
public static boolean isVersionOverlap( String leftVersionOrRange, String rightVersionOrRange )
    throws InvalidVersionSpecificationException
{
    VersionRange pomVersionRange = createVersionRange( leftVersionOrRange );
    if ( !pomVersionRange.hasRestrictions() )
    {
        return true;
    }

    VersionRange oldVersionRange = createVersionRange( rightVersionOrRange );
    if ( !oldVersionRange.hasRestrictions() )
    {
        return true;
    }

    VersionRange result = oldVersionRange.restrict( pomVersionRange );
    return result.hasRestrictions();
}
 
開發者ID:mojohaus,項目名稱:versions-maven-plugin,代碼行數:27,代碼來源:PomHelper.java

示例2: isVersionOverlap

import org.apache.maven.artifact.versioning.VersionRange; //導入方法依賴的package包/類
/**
 * Checks if two versions or ranges have an overlap.
 *
 * @param leftVersionOrRange  the 1st version number or range to test
 * @param rightVersionOrRange the 2nd version number or range to test
 * @return true if both versions have an overlap
 * @throws InvalidVersionSpecificationException
 *          if the versions can't be parsed to a range
 */
public static boolean isVersionOverlap( String leftVersionOrRange, String rightVersionOrRange )
    throws InvalidVersionSpecificationException
{
    VersionRange pomVersionRange = createVersionRange( leftVersionOrRange );
    if ( !pomVersionRange.hasRestrictions() )
    {
        return true;
    }

    VersionRange oldVersionRange = createVersionRange( rightVersionOrRange );
    if ( !oldVersionRange.hasRestrictions() )
    {
        return true;
    }

    VersionRange result = oldVersionRange.restrict( pomVersionRange );
    return result.hasRestrictions();
}
 
開發者ID:petr-ujezdsky,項目名稱:versions-maven-plugin-svn-clone,代碼行數:28,代碼來源:PomHelper.java

示例3: restrictToMinimalCompatible

import org.apache.maven.artifact.versioning.VersionRange; //導入方法依賴的package包/類
private VersionRange restrictToMinimalCompatible(VersionRange ivyVersionRange)
        throws InvalidVersionSpecificationException, MojoExecutionException
{
  VersionRange minimalCompatibleVersionRange = VersionRange.createFromVersionSpec("[" + AbstractEngineMojo.MINIMAL_COMPATIBLE_VERSION + ",)");
  VersionRange restrictedIvyVersionRange = ivyVersionRange.restrict(minimalCompatibleVersionRange);
  if (!restrictedIvyVersionRange.hasRestrictions())
  {
    throw new MojoExecutionException("The ivyVersion '"+ivyVersion+"' is lower than the minimal compatible version"
          + " '"+MINIMAL_COMPATIBLE_VERSION+"'.");
  }
  return restrictedIvyVersionRange;
}
 
開發者ID:axonivy,項目名稱:project-build-plugin,代碼行數:13,代碼來源:AbstractEngineMojo.java


注:本文中的org.apache.maven.artifact.versioning.VersionRange.hasRestrictions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。