List of usage examples for java.lang Package getImplementationTitle
public String getImplementationTitle()
From source file:Main.java
public static void main(String[] args) { // create a package object for java.lang package Package pack = Package.getPackage("java.lang"); // get the Implementation Title for lang package System.out.println(pack.getImplementationTitle()); }
From source file:Main.java
public static void main(String[] a) { 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()); }
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:com.rcaspar.fitbitbat.App.java
/** * Program entry point./*from ww w . ja v a2 s. c o m*/ * * @param args CLI args */ public static void main(final String[] args) { log.debug("main() - args={}", Arrays.asList(args)); final Args arguments = new Args(); try { new JCommander(arguments, args); final GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext( "classpath:application-context.xml"); applicationContext.registerShutdownHook(); applicationContext.start(); final Package appPackage = App.class.getPackage(); log.info("=== {} v.{} started ===", appPackage.getImplementationTitle(), appPackage.getImplementationVersion()); final FitBitBat fitBitBat = applicationContext.getBean(FitBitBat.class); if (fitBitBat.checkCredentials(arguments.getPin())) { fitBitBat.startAsync(); } else { log.error("Bad pin: {}", arguments.getPin()); } } catch (final OAuthException ex) { System.err.println(ex.getMessage()); System.exit(1); } catch (final ParameterException ex) { new JCommander(arguments).usage(); System.exit(-1); } catch (final Exception ex) { log.error("Cannot startup", ex); System.exit(-2); } }
From source file:com.callidusrobotics.MythosRL.java
private static String getImplementationVersion() { final Package myPackage = MythosRL.class.getPackage(); if (myPackage.getImplementationTitle() == null || myPackage.getImplementationVersion() == null) { return "Roguelike Debug Version"; }//w ww.j a va 2 s .c o m return myPackage.getImplementationTitle() + " " + myPackage.getImplementationVersion(); }
From source file:com.callidusrobotics.command.CommandFactory.java
private static boolean isDebugMode() { final Package myPackage = CommandFactory.class.getPackage(); return (myPackage.getImplementationTitle() == null || myPackage.getImplementationVersion() == null); }
From source file:cz.jirutka.validator.collection.internal.HibernateValidatorInfo.java
/** * Returns version of the Hibernate Validator determined from the package * info on classpath./*from w w w . java2 s . c om*/ * * <p>Version number is parsed as: 5.1.1.Final -> 511, 5.2.0-SNAPSHOT -> 520.</p> * * @return A parsed version number, or {@link Integer#MAX_VALUE} if could not be determined. */ public static int getVersion() { Package pkg = HibernateValidator.class.getPackage(); if (pkg != null) { String version = pkg.getImplementationVersion(); String title = pkg.getImplementationTitle(); if (isNotEmpty(version) && "hibernate-validator".equals(title)) { LOG.info("Found Hibernate Validator {}", version); return parseVersion(version); } } LOG.warn("Could not determine Hibernate Validator version"); return Integer.MAX_VALUE; }
From source file:mitm.application.djigzo.DjigzoConfigurator.java
private static void logAllPackages() { List<Package> packages = Arrays.asList(Package.getPackages()); Comparator<Package> packageComparator = new Comparator<Package>() { @Override/* w w w .jav a2s .co m*/ public int compare(Package package1, Package package2) { return package1.getName().compareTo(package2.getName()); } }; Collections.sort(packages, packageComparator); StrBuilder sb = new StrBuilder(1024); sb.appendNewLine(); for (Package pack : packages) { sb.append("Package: ").append(pack.getName()).appendSeparator("; "); sb.append("Title: ").append(pack.getImplementationTitle()).appendSeparator("; "); sb.append("Version: ").append(pack.getImplementationVersion()); sb.appendNewLine(); } logger.info(sb.toString()); }
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:fr.inrialpes.exmo.align.cli.CommonCLI.java
public void usage(String firstlines, String footer) { Package pkg = this.getClass().getPackage(); String rfooter = footer;// w w w . j av a 2s .com if (pkg != null) rfooter += "\n" + pkg.getImplementationTitle() + " " + pkg.getImplementationVersion(); new HelpFormatter().printHelp(80, firstlines, "\nOptions:", options, rfooter); }