Example usage for java.lang Package getSpecificationVendor

List of usage examples for java.lang Package getSpecificationVendor

Introduction

In this page you can find the example usage for java.lang Package getSpecificationVendor.

Prototype

public String getSpecificationVendor() 

Source Link

Document

Return the name of the organization, vendor, or company that owns and maintains the specification of the classes that implement this package.

Usage

From source file:Main.java

public static void main(String[] args) {

    // get the java lang package
    Package pack = Package.getPackage("java.lang");

    // print the specification vendor for this package
    System.out.println(pack.getSpecificationVendor());

}

From source file:PackageInfo.java

public static void main(String[] args) {
    Package p = Package.getPackage("java.lang");

    System.out.println("Name = " + p.getName());

    System.out.println("Implementation title = " + p.getImplementationTitle());

    System.out.println("Implementation vendor = " + p.getImplementationVendor());

    System.out.println("Implementation version = " + p.getImplementationVersion());

    System.out.println("Specification title = " + p.getSpecificationTitle());

    System.out.println("Specification vendor = " + p.getSpecificationVendor());

    System.out.println("Specification version = " + p.getSpecificationVersion());
}

From source file:PackageInfo.java

static void pkgInfo(ClassLoader classLoader, String pkgName, String className) {

    try {// w ww .j  a v a 2  s  .  c  om
        classLoader.loadClass(pkgName + "." + className);

        Package p = Package.getPackage(pkgName);
        if (p == null) {
            System.out.println("WARNING: Package.getPackage(" + pkgName + ") is null");
        } else {
            System.out.println(p);
            System.out.println("Specification Title = " + p.getSpecificationTitle());
            System.out.println("Specification Vendor = " + p.getSpecificationVendor());
            System.out.println("Specification Version = " + p.getSpecificationVersion());

            System.out.println("Implementation Vendor = " + p.getImplementationVendor());
            System.out.println("Implementation Version = " + p.getImplementationVersion());
        }
    } catch (ClassNotFoundException e) {
        System.out.println("Unable to load " + pkgName);
    }

    System.out.println();
}

From source file:com.github.wolf480pl.mias4j.core.runtime.BMClassLoader.java

protected Package copyPackage(Package pkg, CodeSource cs) {
    return definePackage(pkg.getName(), pkg.getSpecificationTitle(), pkg.getSpecificationVersion(),
            pkg.getSpecificationVendor(), pkg.getImplementationTitle(), pkg.getImplementationVersion(),
            pkg.getImplementationVendor(), pkg.isSealed() ? cs.getLocation() : null);
}

From source file:adalid.util.info.JavaInfo.java

public void printPackageDetails(String name) {
    Package pack = Package.getPackage(name);
    out.println("Package " + name + ": " + pack);
    if (pack != null) {
        out.println("\t" + Attributes.Name.IMPLEMENTATION_TITLE + ":   " + pack.getImplementationTitle());
        out.println("\t" + Attributes.Name.IMPLEMENTATION_VENDOR + ":  " + pack.getImplementationVendor());
        out.println("\t" + Attributes.Name.IMPLEMENTATION_VERSION + ": " + pack.getImplementationVersion());
        out.println("\t" + Attributes.Name.SPECIFICATION_TITLE + ":    " + pack.getSpecificationTitle());
        out.println("\t" + Attributes.Name.SPECIFICATION_VENDOR + ":   " + pack.getSpecificationVendor());
        out.println("\t" + Attributes.Name.SPECIFICATION_VERSION + ":  " + pack.getSpecificationVersion());
        out.println();/*  w w w  .j a v a  2  s.c  o  m*/
    }
}

From source file:net.chaosserver.timelord.swingui.Timelord.java

/**
 * Shows the about dialog that tells about the application.
 *///from   ww  w . ja  v  a2 s .  co m
public void showAboutDialog() {
    Package packageInfo = Package.getPackage("net.chaosserver.timelord.swingui");

    if (log.isTraceEnabled()) {
        if (packageInfo != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(packageInfo.getClass().getName());
            sb.append(" [name=");
            sb.append(packageInfo.getName());
            sb.append(", specificationTitle=");
            sb.append(packageInfo.getSpecificationTitle());
            sb.append(", specificationVersion=");
            sb.append(packageInfo.getSpecificationVersion());
            sb.append(", specificationVendor=");
            sb.append(packageInfo.getSpecificationVendor());
            sb.append(", implementationTitle=");
            sb.append(packageInfo.getImplementationTitle());
            sb.append(", implementationVersion=");
            sb.append(packageInfo.getImplementationVersion());
            sb.append(", implementationVendor=");
            sb.append(packageInfo.getImplementationVendor());
            sb.append("]");
            log.trace(sb.toString());
        }
    }

    StringBuffer sb = new StringBuffer();
    sb.append("Timelord");

    if ((packageInfo != null) && (packageInfo.getImplementationVersion() != null)) {
        sb.append(" [");
        sb.append(packageInfo.getImplementationVersion());
        sb.append("]");
    } else {
        Properties appProperties = getAppProperties();
        if (appProperties != null) {
            sb.append(" ");
            sb.append(appProperties.getProperty("implementation.version", "[Unknown Version]"));
        } else {
            sb.append(" [Unknown Version]");
        }
    }

    sb.append("\n");
    sb.append(resourceBundle.getString(RROOT + ".about"));

    JOptionPane.showMessageDialog(applicationFrame, sb.toString(), "About Timelord",
            JOptionPane.INFORMATION_MESSAGE, applicationIcon);
}