Package aPackage = MyClassName.class.getPackage(); String implementationVersion = aPackage.getImplementationVersion(); String implementationVendor = aPackage.getImplementationVendor();
private void addFeature(Features features, NamedFeature feature) { Class<?> type = feature.getType(); features.getEnabled() .add(new Feature(feature.getName(), type.getCanonicalName(), type.getPackage().getImplementationVersion(), type.getPackage().getImplementationVendor())); }
@Override public GroupIdPair apply(final ClientClasspathPlugin a) { final Package p = a.getClass().getPackage(); final GroupIdPair g = new GroupIdPair(p.getImplementationVendor(), p.getImplementationTitle()); if (g.id == null) { reportBadPlugin("title", a); } if (g.group == null) { reportBadPlugin("vendor", a); } return g; }
/** * Creates a provider information instance based on the given package. * * @param pPackage the package to get provider information from. * This should typically be the package containing the Spi class. * * @throws IllegalArgumentException if {@code pPackage == null} */ public ProviderInfo(final Package pPackage) { Validate.notNull(pPackage, "package"); String title = pPackage.getImplementationTitle(); this.title = title != null ? title : pPackage.getName(); String vendor = pPackage.getImplementationVendor(); vendorName = vendor != null ? vendor : fakeVendor(pPackage); String version = pPackage.getImplementationVersion(); this.version = version != null ? version : fakeVersion(pPackage); }
/** * @return Hazelcast's implementation vendor */ public String getAdapterVendorName() { return HZ_PACKAGE.getImplementationVendor(); }
/** * @see Package#getImplementationVendor() */ public static String getVendor() { final String tmpManifestValue = OjAlgoUtils.class.getPackage().getImplementationVendor(); return tmpManifestValue != null ? tmpManifestValue : "Optimatika"; }
/** * Returns the specification vendor. * * @return The specification vendor. */ public static String getImplVendor() { Package versionPackage = Version.class.getPackage(); return versionPackage.getImplementationVendor(); }
/** * @see Package#getImplementationVendor() */ public static String getVendor() { final String tmpManifestValue = OjAlgoUtils.class.getPackage().getImplementationVendor(); return tmpManifestValue != null ? tmpManifestValue : "Optimatika"; }
/** * Returns the specification vendor. * * @return The specification vendor. */ public static String getImplVendor() { Package versionPackage = Version.class.getPackage(); return versionPackage.getImplementationVendor(); }
/** * Return the plug-in vendor. * * @return the plug-in vendor. May be <code>null</code>. */ default String getVendor() { return getClass().getPackage().getImplementationVendor(); }
private static String getFrameworkInfo() { final Package javaRuntimeClassPkg = Runtime.class.getPackage(); final StringBuilder frameworkInfo = new StringBuilder(); frameworkInfo.append("jre:"); frameworkInfo.append(javaRuntimeClassPkg.getImplementationVersion()); frameworkInfo.append(";vendor:"); frameworkInfo.append(javaRuntimeClassPkg.getImplementationVendor()); frameworkInfo.append(";jvm"); frameworkInfo.append(System.getProperty("java.vm.version")); return frameworkInfo.toString(); } }
public static Version parseVersionFromManifest() { Package aPackage = Version.class.getPackage(); return new Version(aPackage.getSpecificationVersion(), aPackage.getImplementationVersion(), aPackage.getImplementationVendor()); } }
private void printReleaseVersion(String moduleName, Package p) { String version = p.getImplementationVersion(); if (StringUtils.isBlank(version)) { // No version is likely due to using an unpacked or modified // jar, or the jar not being packaged with version // information. LOG.info("Version: \"" + moduleName + "\" version is undefined."); return; } LOG.info("Version: " + p.getImplementationTitle() + " " + p.getImplementationVersion() + " (" + p.getImplementationVendor() + ")"); }
public class TheVersionClass { public TheVersionClass() { System.out.println( " Implementation Title:" + this.getClass().getPackage().getImplementationTitle() ); System.out.println( " Implementation Vendor:" + this.getClass().getPackage().getImplementationVendor() ); System.out.println( "Implementation Version:" + this.getClass().getPackage().getImplementationVersion() ); System.out.println( " Specification Tile:" + this.getClass().getPackage().getSpecificationTitle() ); System.out.println( " Specification Vendor:" + this.getClass().getPackage().getSpecificationVendor() ); System.out.println( " Specification Version:" + this.getClass().getPackage().getSpecificationVersion() ); } }
public static String getVersion() { return DigiMorph.class.getPackage().getImplementationTitle() + "\n" + DigiMorph.class.getPackage().getSpecificationVendor() + " - " + DigiMorph.class.getPackage().getImplementationVendor() + "\n" + "Version: " + DigiMorph.class.getPackage().getSpecificationVersion(); }
public static String getVersion() { return DigiMorph.class.getPackage().getImplementationTitle() + "\n" + DigiMorph.class.getPackage().getSpecificationVendor() + " - " + DigiMorph.class.getPackage().getImplementationVendor() + "\n" + "Version: " + DigiMorph.class.getPackage().getSpecificationVersion(); }
public AboutParams(Class<?> clazz) { super(); Package pkg = clazz.getPackage(); String name = clazz.getSimpleName(); title = pkg.getImplementationTitle(); title = StringUtils.isEmpty(title) ? name : title; source = pkg.getImplementationVendor(); set("name", name); set("pkg", pkg.getName()); set("version", pkg.getImplementationVersion()); }
private void addFeature(Features features, NamedFeature feature) { Class<?> type = feature.getType(); features.getEnabled() .add(new Feature(feature.getName(), type.getCanonicalName(), type.getPackage().getImplementationVersion(), type.getPackage().getImplementationVendor())); }
/** * Returns all version information as string. */ public static String asString() { if (getPackage() == null) return "piotr.wendykier@gmail.com"; String vendor = getPackage().getImplementationVendor(); if (vendor == null) vendor = "piotr.wendykier@gmail.com"; return "Version " + getMajorVersion() + "." + getMinorVersion() + "." + getMicroVersion() + "." + getBuildVersion() + " (" + getBuildTime() + ")" + "\nPlease report problems to " + vendor; }
/** * Returns all version information as string. */ public static String asString() { if (getPackage() == null) return "piotr.wendykier@gmail.com"; String vendor = getPackage().getImplementationVendor(); if (vendor == null) vendor = "piotr.wendykier@gmail.com"; return "Version " + getMajorVersion() + "." + getMinorVersion() + "." + getMicroVersion() + "." + getBuildVersion() + " (" + getBuildTime() + ")" + "\nPlease report problems to " + vendor; }