本文整理了Java中org.osgi.framework.Version.getMinor()
方法的一些代码示例,展示了Version.getMinor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getMinor()
方法的具体详情如下:
包路径:org.osgi.framework.Version
类名称:Version
方法名:getMinor
[英]Returns the minor component of this version identifier.
[中]返回此版本标识符的次要组件。
代码示例来源:origin: org.osgi/org.osgi.core
} else {
Version adjacent1 = new Version(left.getMajor(), left.getMinor(), left.getMicro(), left.getQualifier() + "-");
return adjacent1.compareTo(right) >= 0;
if (rightClosed) {
Version adjacent1 = new Version(left.getMajor(), left.getMinor(), left.getMicro(), left.getQualifier() + "-");
return adjacent1.equals(right);
} else {
Version adjacent2 = new Version(left.getMajor(), left.getMinor(), left.getMicro(), left.getQualifier() + "--");
return adjacent2.compareTo(right) >= 0;
代码示例来源:origin: org.eclipse.equinox/common
/**
* Returns the minor (compatible) component of this
* version identifier.
*
* @return the minor version
*/
public int getMinorComponent() {
return version.getMinor();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common
/**
* Returns the minor (compatible) component of this
* version identifier.
*
* @return the minor version
*/
public int getMinorComponent() {
return version.getMinor();
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common
/**
* Returns the minor (compatible) component of this
* version identifier.
*
* @return the minor version
*/
public int getMinorComponent() {
return version.getMinor();
}
代码示例来源:origin: ontop/ontop
public OSGiJdbcDriver(BundleContext context, JdbcRegistry registry) {
String versionString = (String) context.getBundle().getHeaders().get(Constants.BUNDLE_VERSION);
Version version = new Version(versionString);
majorVersion = version.getMajor();
minorVersion = version.getMinor();
this.registry = registry;
}
代码示例来源:origin: com.atlassian.applinks/applinks-common
private URI createDocumentationBaseUrl(AppLinkPluginUtil applinkPluginUtil) {
Version version = applinkPluginUtil.getVersion();
String documentationSpaceKey = String.format("APPLINKS-%02d%d/", version.getMajor(), version.getMinor());
return URI.create("https://confluence.atlassian.com/display/" + documentationSpaceKey);
}
}
代码示例来源:origin: org.eclipse/osgi
private InputStream findNextBestProfile(Generation systemGeneration, String javaEdition, Version javaVersion, String embeddedProfileName) {
InputStream result = null;
int minor = javaVersion.getMinor();
do {
result = findInSystemBundle(systemGeneration, javaEdition + embeddedProfileName + javaVersion.getMajor() + "." + minor + PROFILE_EXT); //$NON-NLS-1$
minor = minor - 1;
} while (result == null && minor > 0);
return result;
}
代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox
private InputStream findNextBestProfile(Generation systemGeneration, String javaEdition, Version javaVersion, String embeddedProfileName) {
InputStream result = null;
int minor = javaVersion.getMinor();
do {
result = findInSystemBundle(systemGeneration, javaEdition + embeddedProfileName + javaVersion.getMajor() + "." + minor + PROFILE_EXT); //$NON-NLS-1$
minor = minor - 1;
} while (result == null && minor > 0);
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
public static int compareMacroMinorMicro(Version v1, Version v2) {
int result = v1.getMajor() - v2.getMajor();
if (result != 0)
return result;
result = v1.getMinor() - v2.getMinor();
if (result != 0)
return result;
result = v1.getMicro() - v2.getMicro();
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.osgi
private static void getImportFrom(ExportPackageDescription export, StringBuffer importStatement) {
importStatement.append(export.getName()).append(ELEMENT_SEPARATOR);
Version version = export.getVersion();
importStatement.append(Constants.VERSION_ATTRIBUTE).append(EQUALS_QUOTE).append('[').append(version).append(',').append(new Version(version.getMajor(), version.getMinor(), version.getMicro() + 1)).append(')').append('\"');
addMap(importStatement, export.getAttributes(), "="); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse/org.eclipse.osgi
private URL findNextBestProfile(String javaEdition, Version javaVersion) {
URL result = null;
int minor = javaVersion.getMinor();
do {
result = findInSystemBundle(javaEdition + javaVersion.getMajor() + "." + minor + PROFILE_EXT); //$NON-NLS-1$
minor = minor - 1;
} while (result == null && minor > 0);
return result;
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi
private void writeVersion(Version version, DataOutputStream out) throws IOException {
if (version == null || version.equals(Version.emptyVersion)) {
out.writeByte(StateReader.NULL);
return;
}
out.writeByte(StateReader.OBJECT);
out.writeInt(version.getMajor());
out.writeInt(version.getMinor());
out.writeInt(version.getMicro());
writeQualifier(version.getQualifier(), out);
}
代码示例来源:origin: org.eclipse/osgi
private static void writeVersion(Version version, DataOutputStream out) throws IOException {
if (version == null || version.equals(Version.emptyVersion)) {
out.writeByte(NULL);
return;
}
out.writeByte(OBJECT);
out.writeInt(version.getMajor());
out.writeInt(version.getMinor());
out.writeInt(version.getMicro());
writeQualifier(version.getQualifier(), out);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
public static boolean isEquivalentTo(Version v1, Version v2) {
if (v1.getMajor() != v2.getMajor() || v1.getMinor() != v2.getMinor())
return false;
if (v1.getMicro() > v2.getMicro())
return true;
if (v1.getMicro() < v2.getMicro())
return false;
return v1.getQualifier().compareTo(v2.getQualifier()) >= 0;
}
代码示例来源:origin: org.sonatype.tycho/maven-osgi-source-plugin
private Version getExpandedVersion(String versionStr)
{
Version version = Version.parseVersion( versionStr );
if ( VERSION_QUALIFIER.equals(version.getQualifier()) )
{
return new Version(version.getMajor(), version.getMinor(), version.getMicro(), qualifier);
}
return version;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private String computeInitialPluginVersion(String pluginVersion) {
if (pluginVersion != null && VersionUtil.validateVersion(pluginVersion).isOK()) {
Version pvi = Version.parseVersion(pluginVersion);
return pvi.getMajor() + "." + pvi.getMinor() //$NON-NLS-1$
+ "." + pvi.getMicro(); //$NON-NLS-1$
}
return pluginVersion;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
public static String computeInitialPluginVersion(String version) {
if (version != null && VersionUtil.validateVersion(version).isOK()) {
Version pvi = Version.parseVersion(version);
return pvi.getMajor() + "." + pvi.getMinor() //$NON-NLS-1$
+ "." + pvi.getMicro(); //$NON-NLS-1$
}
return version;
}
代码示例来源:origin: com.springsource.bundlor/com.springsource.bundlor
/**
* {@inheritDoc}
*/
public String transform(String propertyName, String value, String pattern) {
Version version = new Version(value);
VersionExpander expander = getVersionExpander(pattern);
return expander.expand(version.getMajor(), version.getMinor(), version.getMicro(), version.getQualifier());
}
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher
/**
* Create an omni version from an OSGi <code>version</code>.
* @param version The OSGi version. Can be <code>null</code>.
* @return The created omni version
*/
public static Version fromOSGiVersion(org.osgi.framework.Version version) {
if (version == null)
return null;
if (version.getMajor() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE)
return Version.MAX_VERSION;
return Version.createOSGi(version.getMajor(), version.getMinor(), version.getMicro(), version.getQualifier());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
private static Version fromOSGiVersion(org.osgi.framework.Version version) {
if (version == null)
return Version.MAX_VERSION;
if (version.getMajor() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE && version.getMicro() == Integer.MAX_VALUE)
return Version.MAX_VERSION;
return Version.createOSGi(version.getMajor(), version.getMinor(), version.getMicro(), version.getQualifier());
}
内容来源于网络,如有侵权,请联系作者删除!