/** * Parses a version identifier from the specified string. * * See <code>Version(String)</code> for the format of the version string. * * @param version String representation of the version identifier. Leading and trailing whitespace will be ignored. * @return A <code>Version</code> object representing the version identifier. If <code>version</code> is <code>null</code> or the empty string then * <code>emptyVersion</code> will be returned. * @throws IllegalArgumentException If <code>version</code> is improperly formatted. */ public static Version parseVersion(String version) { if (version == null) { return emptyVersion; } version = version.trim(); if (version.length() == 0) { return emptyVersion; } return new Version(version); }
/** * Creates a version identifier from the specified components. * * @param major Major component of the version identifier. * @param minor Minor component of the version identifier. * @param micro Micro component of the version identifier. * @param qualifier Qualifier component of the version identifier. If <code>null</code> is specified, then the qualifier will be set to the empty string. * @param snapshot Indicates snapshot state of the version. * @throws IllegalArgumentException If the numerical components are negative or the qualifier string is invalid. */ public Version(int major, int minor, int micro, String qualifier, boolean snapshot) { if (qualifier == null) { qualifier = ""; } this.major = major; this.minor = minor; this.micro = micro; this.qualifier = qualifier; this.snapshot = snapshot; validate(); }
/** * Returns the current {@link OperatingSystem}. * * @return the current OS */ public static OperatingSystem getOperatingSystem() { String name = System.getProperty("os.name"); String processor = OSHelper.parseProcessor(System.getProperty("os.arch")); String versionStr = OSHelper.parseVersion(System.getProperty("os.version")); Version version = Version.parseVersion(versionStr); return new OperatingSystem(name, processor, version); }
this.qualifier = qualifier; this.snapshot = snapshot; validate();
public MetroContributionServiceListener() { // JAX-WS classes PackageInfo wsInfo = new PackageInfo("javax.xml.ws.*"); wsInfo.setMinVersion(new Version("2.2.0")); wsImport = new JavaImport(wsInfo); // SAAJ API and implementation PackageInfo saajInfo = new PackageInfo("javax.xml.soap.*"); saajInfo.setMinVersion(new Version("1.3.0")); saajImport = new JavaImport(saajInfo); PackageInfo sunSaajInfo = new PackageInfo("com.sun.xml.messaging.saaj.*"); sunSaajInfo.setMinVersion(new Version("2.0.1")); sunSaajImport = new JavaImport(sunSaajInfo); }
@Override public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (processor != null ? processor.hashCode() : 0); result = 31 * result + (minVersion != null ? minVersion.hashCode() : 0); result = 31 * result + (maxVersion != null ? maxVersion.hashCode() : 0); return result; }
public MetroContributionServiceListener() { // JAX-WS classes PackageInfo wsInfo = new PackageInfo("javax.xml.ws.*"); wsInfo.setMinVersion(new Version("2.2.0")); wsImport = new JavaImport(wsInfo); // SAAJ API and implementation PackageInfo saajInfo = new PackageInfo("javax.xml.soap.*"); saajInfo.setMinVersion(new Version("1.3.0")); saajImport = new JavaImport(saajInfo); PackageInfo sunSaajInfo = new PackageInfo("com.sun.xml.messaging.saaj.*"); sunSaajInfo.setMinVersion(new Version("2.0.1")); sunSaajImport = new JavaImport(sunSaajInfo); }
Version version = new Version(entry.getValue()); PackageInfo info = new PackageInfo(entry.getKey(), version); JavaExport export = new JavaExport(info);
Version version = new Version(entry.getValue()); PackageInfo info = new PackageInfo(entry.getKey(), version); JavaExport export = new JavaExport(info);