本文整理了Java中java.lang.Package.getSpecificationVendor()
方法的一些代码示例,展示了Package.getSpecificationVendor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Package.getSpecificationVendor()
方法的具体详情如下:
包路径:java.lang.Package
类名称:Package
方法名:getSpecificationVendor
[英]Returns the name of the vendor or organization that owns and maintains the specification this package implements, or null if this is unknown.
[中]
代码示例来源:origin: com.jtransc/jtransc-rt
public String getImplementationVendor() {
return getSpecificationVendor();
}
代码示例来源:origin: net.jxta/jxta-jxse
/**
* Returns the specification vendor.
*
* @return The specification vendor.
*/
public static String getSpecVendor() {
Package versionPackage = Version.class.getPackage();
return versionPackage.getSpecificationVendor();
}
代码示例来源:origin: net.jxta/jxta-jxse
/**
* Returns the specification vendor.
*
* @return The specification vendor.
*/
public static String getSpecVendor() {
Package versionPackage = Version.class.getPackage();
return versionPackage.getSpecificationVendor();
}
代码示例来源:origin: stackoverflow.com
public void getSDKInfo() {
Package pkg = Manifest.class.getPackage();
String specTitle = pkg.getSpecificationTitle();
String vendor = pkg.getSpecificationVendor();
String version = pkg.getSpecificationVersion();
}
代码示例来源:origin: stackoverflow.com
Package myPackage = Manifest.class.getPackage();
String specTitle = myPackage.getSpecificationTitle();
String vendor = myPackage.getSpecificationVendor();
String virsion = myPackage.getSpecificationVersion();
代码示例来源: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: 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: 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: io.humble/humble-video-arch-i686-apple-darwin12
/**
* Prints the version of this library to System.out along with
* some information on what this jar is.
*/
public static String getVersionInfo() {
final Class<?> c = Version.class;
final StringBuilder b = new StringBuilder();
final Package p = c.getPackage();
b.append("Class: " + c.getCanonicalName() + "; ");
b.append("Specification Vendor: " + p.getSpecificationVendor() + "; ");
b.append("Specification Title: " + p.getSpecificationTitle() + "; ");
b.append("Specification Version: " + p.getSpecificationVersion() + "; ");
b.append("Implementation Vendor: " + p.getImplementationVendor() + "; ");
b.append("Implementation Title: " + p.getImplementationTitle() + "; ");
b.append("Implementation Version: " + p.getImplementationVersion() + ";");
return b.toString();
}
代码示例来源:origin: io.humble/humble-video-arch-i686-pc-linux-gnu6
/**
* Prints the version of this library to System.out along with
* some information on what this jar is.
*/
public static String getVersionInfo() {
final Class<?> c = Version.class;
final StringBuilder b = new StringBuilder();
final Package p = c.getPackage();
b.append("Class: " + c.getCanonicalName() + "; ");
b.append("Specification Vendor: " + p.getSpecificationVendor() + "; ");
b.append("Specification Title: " + p.getSpecificationTitle() + "; ");
b.append("Specification Version: " + p.getSpecificationVersion() + "; ");
b.append("Implementation Vendor: " + p.getImplementationVendor() + "; ");
b.append("Implementation Title: " + p.getImplementationTitle() + "; ");
b.append("Implementation Version: " + p.getImplementationVersion() + ";");
return b.toString();
}
代码示例来源:origin: io.humble/humble-video-arch-x86_64-pc-linux-gnu6
/**
* Prints the version of this library to System.out along with
* some information on what this jar is.
*/
public static String getVersionInfo() {
final Class<?> c = Version.class;
final StringBuilder b = new StringBuilder();
final Package p = c.getPackage();
b.append("Class: " + c.getCanonicalName() + "; ");
b.append("Specification Vendor: " + p.getSpecificationVendor() + "; ");
b.append("Specification Title: " + p.getSpecificationTitle() + "; ");
b.append("Specification Version: " + p.getSpecificationVersion() + "; ");
b.append("Implementation Vendor: " + p.getImplementationVendor() + "; ");
b.append("Implementation Title: " + p.getImplementationTitle() + "; ");
b.append("Implementation Version: " + p.getImplementationVersion() + ";");
return b.toString();
}
代码示例来源:origin: CoreMedia/jangaroo-tools
private void printVersion() {
String pkgName = "net.jangaroo.jooc";
Package pkg = Package.getPackage(pkgName);
String specTitle = pkg.getSpecificationTitle();
if (specTitle == null) {
System.out.println("cannot retrieve package version information for " + pkgName); // NOSONAR this is a commandline tool
return;
}
String specVendor = pkg.getSpecificationVendor();
String specVersion = pkg.getSpecificationVersion();
String implTitle = pkg.getImplementationTitle();
String implVersion = pkg.getImplementationVersion();
System.out.println(specTitle + " version " + specVersion); // NOSONAR this is a cmd line tool
System.out.println(implTitle + " (build " + implVersion + ")"); // NOSONAR this is a cmd line tool
System.out.println(specVendor); // NOSONAR this is a cmd line tool
}
代码示例来源:origin: net.sf.beezle.sushi/sushi
public void invoke() throws Exception {
Package pkg;
pkg = getClass().getPackage();
if (pkg == null) {
console.info.println("unknown version");
} else {
console.info.println(pkg.getName());
console.info.println(" specification title: " + pkg.getSpecificationTitle());
console.info.println(" specification version: " + pkg.getSpecificationVersion());
console.info.println(" specification vendor: " + pkg.getSpecificationVendor());
console.info.println(" implementation title: " + pkg.getImplementationTitle());
console.info.println(" implementation version: " + pkg.getImplementationVersion());
console.info.println(" implementation vendor: " + pkg.getImplementationVendor());
}
console.verbose.println("Platform encoding: " + System.getProperty("file.encoding"));
console.verbose.println("Default Locale: " + Locale.getDefault());
console.verbose.println("Scanner Locale: " + console.input.locale());
}
};
代码示例来源:origin: net.oneandone/inline
public void run() {
Package pkg;
pkg = getClass().getPackage();
if (pkg == null) {
console.info.println("unknown version");
} else if (console.getVerbose()) {
console.verbose.println(pkg.getName());
console.verbose.println(" specification title: " + pkg.getSpecificationTitle());
console.verbose.println(" specification version: " + pkg.getSpecificationVersion());
console.verbose.println(" specification vendor: " + pkg.getSpecificationVendor());
console.verbose.println(" implementation title: " + pkg.getImplementationTitle());
console.verbose.println(" implementation version: " + pkg.getImplementationVersion());
console.verbose.println(" implementation vendor: " + pkg.getImplementationVendor());
console.verbose.println();
console.verbose.println("Java Version: " + System.getProperty("java.version"));
console.verbose.println("Platform encoding: " + System.getProperty("file.encoding"));
console.verbose.println("Default Locale: " + Locale.getDefault());
console.verbose.println("Scanner Locale: " + console.input.locale());
} else {
console.info.println(pkg.getSpecificationVersion());
}
}
}
代码示例来源:origin: knightliao/common-utils
private void setPackage(String location) {
Package pack = Package.getPackage(location);
if (pack == null) {
logger.warn("can,t find AppInfo");
return;
}
appVersion = pack.getImplementationVersion();
this.specificationTitle = pack.getSpecificationTitle();
this.specificationVersion = pack.getSpecificationVersion();
this.specificationVendor = pack.getSpecificationVendor();
this.implementationTitle = pack.getImplementationTitle();
this.implementationVersion = pack.getImplementationVersion();
this.implementationVendor = pack.getImplementationVendor();
}
代码示例来源:origin: org.apfloat/apfloat-samples
/**
* Get information about this applet.
*
* @return Information about this applet.
*/
@Override
public String getAppletInfo()
{
Object builderFactory = ApfloatContext.getContext().getBuilderFactory();
Package specificationPackage = Package.getPackage("org.apfloat"),
implementationPackage = builderFactory.getClass().getPackage();
String lineSeparator = System.getProperty("line.separator");
return "Pi calculation applet" + lineSeparator +
"Written by Mikko Tommila 2002 - 2017" + lineSeparator +
"Specification-Title: " + specificationPackage.getSpecificationTitle() + lineSeparator +
"Specification-Version: " + specificationPackage.getSpecificationVersion() + lineSeparator +
"Specification-Vendor: " + specificationPackage.getSpecificationVendor() + lineSeparator +
"Implementation-Title: " + implementationPackage.getImplementationTitle() + lineSeparator +
"Implementation-Version: " + implementationPackage.getImplementationVersion() + lineSeparator +
"Implementation-Vendor: " + implementationPackage.getImplementationVendor() + lineSeparator +
"Java version: " + System.getProperty("java.version") + lineSeparator +
"Java Virtual Machine: " + System.getProperty("java.vm.name");
}
}
代码示例来源:origin: com.qwazr/qwazr-server
WelcomeStatus(final GenericServer server, final Boolean showProperties, final Boolean showEnvVars)
throws IOException {
this.webapp_endpoints = server == null ? null : server.getWebAppEndPoints();
this.webservice_endpoints = server == null ? null : server.getWebServiceEndPoints();
final Package pkg = getClass().getPackage();
implementation = new TitleVendorVersion(pkg.getImplementationTitle(), pkg.getImplementationVendor(),
pkg.getImplementationVersion());
specification = new TitleVendorVersion(pkg.getSpecificationTitle(), pkg.getSpecificationVendor(),
pkg.getSpecificationVersion());
memory = new MemoryStatus();
file_stores = new LinkedHashMap<>();
for (Path rootDir : FileSystems.getDefault().getRootDirectories()) {
if (!Files.isReadable(rootDir))
continue;
final FileStore fileStore = Files.getFileStore(rootDir);
if (fileStore.getTotalSpace() > 0)
file_stores.put(rootDir.toString(), new DiskStatus(fileStore));
}
runtime = new RuntimeStatus();
if (showProperties != null && showProperties) {
properties = new TreeMap<>();
System.getProperties().forEach((key, value) -> properties.put(key.toString(), value));
} else
properties = null;
if (showEnvVars != null && showEnvVars)
env = new TreeMap<>(System.getenv());
else
env = null;
}
代码示例来源:origin: teatrove/teatrove
private static void initFromPackage(PackageDescriptor pd,
Package pkg) {
pd.setExists(true);
String specificationTitle = pkg.getSpecificationTitle();
String specificationVersion = pkg.getSpecificationVersion();
String specificationVendor = pkg.getSpecificationVendor();
String implementationTitle = pkg.getImplementationTitle();
String implementationVersion = pkg.getImplementationVersion();
String implementationVendor = pkg.getImplementationVendor();
if (implementationTitle == null) {
implementationTitle = specificationTitle;
}
if (implementationVersion == null) {
implementationVersion = specificationVersion;
}
if (implementationVendor == null) {
implementationVendor = specificationVendor;
}
pd.setSpecificationTitle(specificationTitle);
pd.setSpecificationVersion(specificationVersion);
pd.setSpecificationVendor(specificationVendor);
pd.setImplementationTitle(implementationTitle);
pd.setImplementationVersion(implementationVersion);
pd.setImplementationVendor(implementationVendor);
pd.setProduct(implementationTitle);
pd.setProductVersion(implementationVersion);
}
代码示例来源:origin: org.apache.commons/commons-vfs2
/**
* Verify the package loaded with class loader.
*/
private void verifyPackage(final Package pack, final boolean sealed) {
if (getBaseFolder().getFileSystem().hasCapability(Capability.MANIFEST_ATTRIBUTES)) {
assertEquals("ImplTitle", pack.getImplementationTitle());
assertEquals("ImplVendor", pack.getImplementationVendor());
assertEquals("1.1", pack.getImplementationVersion());
assertEquals("SpecTitle", pack.getSpecificationTitle());
assertEquals("SpecVendor", pack.getSpecificationVendor());
assertEquals("1.0", pack.getSpecificationVersion());
assertEquals(sealed, pack.isSealed());
} else {
assertNull(pack.getImplementationTitle());
assertNull(pack.getImplementationVendor());
assertNull(pack.getImplementationVersion());
assertNull(pack.getSpecificationTitle());
assertNull(pack.getSpecificationVendor());
assertNull(pack.getSpecificationVersion());
assertFalse(pack.isSealed());
}
}
代码示例来源:origin: apache/commons-vfs
/**
* Verify the package loaded with class loader.
*/
private void verifyPackage(final Package pack, final boolean sealed) {
if (getBaseFolder().getFileSystem().hasCapability(Capability.MANIFEST_ATTRIBUTES)) {
assertEquals("ImplTitle", pack.getImplementationTitle());
assertEquals("ImplVendor", pack.getImplementationVendor());
assertEquals("1.1", pack.getImplementationVersion());
assertEquals("SpecTitle", pack.getSpecificationTitle());
assertEquals("SpecVendor", pack.getSpecificationVendor());
assertEquals("1.0", pack.getSpecificationVersion());
assertEquals(sealed, pack.isSealed());
} else {
assertNull(pack.getImplementationTitle());
assertNull(pack.getImplementationVendor());
assertNull(pack.getImplementationVersion());
assertNull(pack.getSpecificationTitle());
assertNull(pack.getSpecificationVendor());
assertNull(pack.getSpecificationVersion());
assertFalse(pack.isSealed());
}
}
内容来源于网络,如有侵权,请联系作者删除!