aQute.bnd.version.Version.isVersion()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中aQute.bnd.version.Version.isVersion()方法的一些代码示例,展示了Version.isVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.isVersion()方法的具体详情如下:
包路径:aQute.bnd.version.Version
类名称:Version
方法名:isVersion

Version.isVersion介绍

暂无

代码示例

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

public static boolean isOSGiVersionRange(String range) {
  return Version.isVersion(range) || isVersionRange(range);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public static boolean isOSGiVersionRange(String range) {
  return Version.isVersion(range) || isVersionRange(range);
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

public static boolean isOSGiVersionRange(String range) {
  return Version.isVersion(range) || isVersionRange(range);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public static boolean isOSGiVersionRange(String range) {
  return Version.isVersion(range) || isVersionRange(range);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public String getBndInfo(String key, String defaultValue) {
  if (bndInfo == null) {
    try {
      Properties bndInfoLocal = new UTF8Properties();
      URL url = Analyzer.class.getResource("bnd.info");
      if (url != null) {
        try (InputStream in = url.openStream()) {
          bndInfoLocal.load(in);
        }
      }
      String v = bndInfoLocal.getProperty("version");
      if (!Version.isVersion(v)) {
        bndInfoLocal.put("version", About.CURRENT.toString());
      }
      bndInfo = bndInfoLocal;
    } catch (Exception e) {
      e.printStackTrace();
      return defaultValue;
    }
  }
  String value = bndInfo.getProperty(key);
  if (value == null)
    return defaultValue;
  return value;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public String getBndInfo(String key, String defaultValue) {
  if (bndInfo == null) {
    try {
      Properties bndInfoLocal = new UTF8Properties();
      URL url = Analyzer.class.getResource("bnd.info");
      if (url != null) {
        try (InputStream in = url.openStream()) {
          bndInfoLocal.load(in);
        }
      }
      String v = bndInfoLocal.getProperty("version");
      if (!Version.isVersion(v)) {
        bndInfoLocal.put("version", About.CURRENT.toString());
      }
      bndInfo = bndInfoLocal;
    } catch (Exception e) {
      e.printStackTrace();
      return defaultValue;
    }
  }
  String value = bndInfo.getProperty(key);
  if (value == null)
    return defaultValue;
  return value;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public static VersionRange parseOSGiVersionRange(String version) {
  if (Version.isVersion(version))
    return new VersionRange(new Version(version), Version.HIGHEST);
  if (isVersionRange(version))
    return new VersionRange(version);
  return null;
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

public static VersionRange parseOSGiVersionRange(String version) {
  if (Version.isVersion(version))
    return new VersionRange(new Version(version), Version.HIGHEST);
  if (isVersionRange(version))
    return new VersionRange(version);
  return null;
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

public static VersionRange parseOSGiVersionRange(String version) {
  if (Version.isVersion(version))
    return new VersionRange(new Version(version), Version.HIGHEST);
  if (isVersionRange(version))
    return new VersionRange(version);
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public static VersionRange parseOSGiVersionRange(String version) {
  if (Version.isVersion(version))
    return new VersionRange(new Version(version), Version.HIGHEST);
  if (isVersionRange(version))
    return new VersionRange(version);
  return null;
}

代码示例来源:origin: com.athaydes.osgiaas/osgiaas-jar-wrap

Analyzer analyzer = new Analyzer();
analyzer.setJar( newJar );
analyzer.setBundleVersion( Version.isVersion( version ) ?
    Version.parseVersion( version ) :
    MavenVersion.parseString( version ).getOSGiVersion() );

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public static VersionRange likeOSGi(String version) {
    if (version == null) {
      return new VersionRange(Version.LOWEST, Version.HIGHEST);
    }

    if (Version.isVersion(version)) {
      return new VersionRange(new Version(version), Version.HIGHEST);
    }
    if (isVersionRange(version)) {
      return new VersionRange(version);
    }
    return null;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public static VersionRange likeOSGi(String version) {
    if (version == null) {
      return new VersionRange(Version.LOWEST, Version.HIGHEST);
    }

    if (Version.isVersion(version)) {
      return new VersionRange(new Version(version), Version.HIGHEST);
    }
    if (isVersionRange(version)) {
      return new VersionRange(version);
    }
    return null;
  }
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

public static VersionRange likeOSGi(String version) {
    if (version == null) {
      return new VersionRange(Version.LOWEST, Version.HIGHEST);
    }

    if (Version.isVersion(version)) {
      return new VersionRange(new Version(version), Version.HIGHEST);
    }
    if (isVersionRange(version)) {
      return new VersionRange(version);
    }
    return null;
  }
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

public static VersionRange likeOSGi(String version) {
    if (version == null) {
      return new VersionRange(Version.LOWEST, Version.HIGHEST);
    }

    if (Version.isVersion(version)) {
      return new VersionRange(new Version(version), Version.HIGHEST);
    }
    if (isVersionRange(version)) {
      return new VersionRange(version);
    }
    return null;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

version = "0";
if (Version.isVersion(version)) {
  if (!range.includes(new Version(version))) {
    continue;

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

version = "0";
if (Version.isVersion(version)) {
  if (!range.includes(new Version(version))) {
    continue;

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public static Version toVersion(Object v) {
  if (v instanceof Version)
    return (Version) v;
  if (v instanceof org.osgi.framework.Version) {
    org.osgi.framework.Version o = (org.osgi.framework.Version) v;
    String q = o.getQualifier();
    return q.isEmpty() ? new Version(o.getMajor(), o.getMinor(), o.getMicro())
      : new Version(o.getMajor(), o.getMinor(), o.getMicro(), q);
  }
  if (v instanceof String) {
    if (!Version.isVersion((String) v))
      return null;
    return new Version((String) v);
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public static Version toVersion(Object v) {
  if (v instanceof Version)
    return (Version) v;
  if (v instanceof org.osgi.framework.Version) {
    org.osgi.framework.Version o = (org.osgi.framework.Version) v;
    String q = o.getQualifier();
    return q.isEmpty() ? new Version(o.getMajor(), o.getMinor(), o.getMicro())
      : new Version(o.getMajor(), o.getMinor(), o.getMicro(), q);
  }
  if (v instanceof String) {
    if (!Version.isVersion((String) v))
      return null;
    return new Version((String) v);
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

if (versionString == null)
  versionString = "0";
else if (!aQute.bnd.version.Version.isVersion(versionString))
  throw new IllegalArgumentException("Invalid version in bundle " + bsn + ": " + versionString);
aQute.bnd.version.Version version = aQute.bnd.version.Version.parseVersion(versionString);

相关文章