java.lang.Package.getImplementationVendor()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(146)

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

Package.getImplementationVendor介绍

[英]Returns the name of the vendor or organization that provides this implementation of the package, or null if this is unknown. The format of this string is unspecified.
[中]返回提供此包实现的供应商或组织的名称,如果未知,则返回null。此字符串的格式未指定。

代码示例

代码示例来源:origin: stackoverflow.com

Package aPackage = MyClassName.class.getPackage();
String implementationVersion = aPackage.getImplementationVersion();
String implementationVendor = aPackage.getImplementationVendor();

代码示例来源:origin: org.springframework.cloud/spring-cloud-commons

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()));
}

代码示例来源:origin: hcoles/pitest

@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;
}

代码示例来源:origin: haraldk/TwelveMonkeys

/**
 * 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);
}

代码示例来源:origin: com.hazelcast/hazelcast-jca

/**
 * @return Hazelcast's implementation vendor
 */
public String getAdapterVendorName() {
  return HZ_PACKAGE.getImplementationVendor();
}

代码示例来源:origin: optimatika/ojAlgo

/**
 * @see Package#getImplementationVendor()
 */
public static String getVendor() {
  final String tmpManifestValue = OjAlgoUtils.class.getPackage().getImplementationVendor();
  return tmpManifestValue != null ? tmpManifestValue : "Optimatika";
}

代码示例来源:origin: net.jxta/jxta-jxse

/**
 *  Returns the specification vendor.
 *
 *  @return The specification vendor.
 */
public static String getImplVendor() {
  Package versionPackage = Version.class.getPackage();
  
  return versionPackage.getImplementationVendor();
}

代码示例来源:origin: org.ojalgo/ojalgo

/**
 * @see Package#getImplementationVendor()
 */
public static String getVendor() {
  final String tmpManifestValue = OjAlgoUtils.class.getPackage().getImplementationVendor();
  return tmpManifestValue != null ? tmpManifestValue : "Optimatika";
}

代码示例来源:origin: net.jxta/jxta-jxse

/**
 *  Returns the specification vendor.
 *
 *  @return The specification vendor.
 */
public static String getImplVendor() {
  Package versionPackage = Version.class.getPackage();
  
  return versionPackage.getImplementationVendor();
}

代码示例来源:origin: org.ligoj.bootstrap/bootstrap-core

/**
 * Return the plug-in vendor.
 *
 * @return the plug-in vendor. May be <code>null</code>.
 */
default String getVendor() {
  return getClass().getPackage().getImplementationVendor();
}

代码示例来源:origin: Azure/azure-event-hubs-java

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();
  }
}

代码示例来源:origin: cpesch/RouteConverter

public static Version parseVersionFromManifest() {
    Package aPackage = Version.class.getPackage();
    return new Version(aPackage.getSpecificationVersion(),
        aPackage.getImplementationVersion(),
        aPackage.getImplementationVendor());
  }
}

代码示例来源:origin: com.norconex.collectors/norconex-collector-core

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() + ")");
}

代码示例来源:origin: stackoverflow.com

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() );
  }
}

代码示例来源:origin: eu.fbk.dh/tint-digimorph

public static String getVersion() {
  return DigiMorph.class.getPackage().getImplementationTitle() + "\n"
      + DigiMorph.class.getPackage().getSpecificationVendor() + " - "
      + DigiMorph.class.getPackage().getImplementationVendor() + "\n"
      + "Version: " + DigiMorph.class.getPackage().getSpecificationVersion();
}

代码示例来源:origin: dhfbk/tint

public static String getVersion() {
  return DigiMorph.class.getPackage().getImplementationTitle() + "\n"
      + DigiMorph.class.getPackage().getSpecificationVendor() + " - "
      + DigiMorph.class.getPackage().getImplementationVendor() + "\n"
      + "Version: " + DigiMorph.class.getPackage().getSpecificationVersion();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

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());
}

代码示例来源:origin: spring-cloud/spring-cloud-commons

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()));
}

代码示例来源:origin: rwl/ParallelColt

/**
 * 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;
}

代码示例来源:origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * 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;
}

相关文章