/** * {@inheritDoc} */ public String getName() { return aPackage.getName(); } }
/** * Return the full version string of the present Spring codebase, * or {@code null} if it cannot be determined. * @see Package#getImplementationVersion() */ @Nullable public static String getVersion() { Package pkg = SpringVersion.class.getPackage(); return (pkg != null ? pkg.getImplementationVersion() : null); }
private static Ignore findAnnotation(Package testPackage) { if (testPackage == null) { return null; } Ignore result = testPackage.getAnnotation(Ignore.class); if (result != null) { return result; } String[] parts = testPackage.getName().split("\\."); String[] parentParts = Arrays.copyOf(parts, parts.length - 1); String parentPackageName = Strings.join(".", parentParts); if (parentPackageName.isEmpty()) { return null; } return findAnnotation(Package.getPackage(parentPackageName)); } }
/** * Load the unique extensions and return their implementation-versions * * @return map of extensions loaded with their respective implementation versions. */ private List<ModuleVersion> getExtensionVersions(Collection<DruidModule> druidModules) { List<ModuleVersion> moduleVersions = new ArrayList<>(); for (DruidModule module : druidModules) { String artifact = module.getClass().getPackage().getImplementationTitle(); String version = module.getClass().getPackage().getImplementationVersion(); moduleVersions.add(new ModuleVersion(module.getClass().getCanonicalName(), artifact, version)); } return moduleVersions; } }
public static String getVersion(Class<?> cls, String defaultVersion) { try { String version = cls.getPackage().getImplementationVersion(); if (StringUtils.isEmpty(version)) { version = cls.getPackage().getSpecificationVersion();
if (outputClassPackage != null && outputClassPackage.isAnnotationPresent(XmlSchema.class)) { XmlSchema annotation = outputClassPackage.getAnnotation(XmlSchema.class); namespaceUri = annotation.namespace();
private boolean parseMethodAuthFlag(final Method actionMethod) { if (actionMethod.getAnnotation(Auth.class) != null) { return true; } final Class declaringClass = actionMethod.getDeclaringClass(); if (declaringClass.getAnnotation(Auth.class) != null) { return true; } if (declaringClass.getPackage().getAnnotation(Auth.class) != null) { return true; } return false; }
public static String getVersion(Class<?> cls, String defaultVersion) { try { String version = cls.getPackage().getImplementationVersion(); if (StringUtils.isEmpty(version)) { version = cls.getPackage().getSpecificationVersion();
private static String name( Package location, String name ) { return location.getName() + "." + name; }
String getImplementationVersion(Class type) { if (type == null) { return "na"; } Package aPackage = type.getPackage(); if (aPackage != null) { String v = aPackage.getImplementationVersion(); if (v == null) { return "na"; } else { return v; } } return "na"; }
private static boolean isSamePackage(Package childPackage, Package classPackage) { boolean isSamePackage = false; if ((null == childPackage) && (null == classPackage)) { isSamePackage = true; } if ((null != childPackage) && (null != classPackage)) { isSamePackage = childPackage.getName().equals(classPackage.getName()); } return isSamePackage; }
private String getDruidVersion() { return Status.class.getPackage().getImplementationVersion(); }
/** * @since 2.7 */ public static String getPackageName(Class<?> cls) { Package pkg = cls.getPackage(); return (pkg == null) ? null : pkg.getName(); }
@Override protected String getVersionString() { return "reader-" + DexFileReader.class.getPackage().getImplementationVersion() + ", translator-" + Dex2jar.class.getPackage().getImplementationVersion() + ", ir-" + ET.class.getPackage().getImplementationVersion(); }
/** * @since 2.7 */ public static String getPackageName(Class<?> cls) { Package pkg = cls.getPackage(); return (pkg == null) ? null : pkg.getName(); }
/** * Returns the version string printed when the user requests version help (--version or -V). * @return a version string based on the package implementation version */ private static String getVersionString() { return "Checkstyle version: " + Main.class.getPackage().getImplementationVersion(); }
/** * {@inheritDoc} */ public void setLoggerContext(LoggerContext lc) { this.lc = lc; this.logger = lc.getLogger(getClass().getPackage().getName()); }
public static String getVersionString() { if ( version == null ) { version = Version.class.getPackage().getImplementationVersion(); if ( version == null ) { version = "[WORKING]"; } } return version; } }
/** * Logs to org.skife.jdbi.v2 logger at the debug level */ public LogbackLog() { this((Logger) LoggerFactory.getLogger(DBI.class.getPackage().getName())); }
public boolean showVersionIfRequested() { if (version) { String clientVersion = Presto.class.getPackage().getImplementationVersion(); System.out.println("Presto CLI " + firstNonNull(clientVersion, "(version unknown)")); } return version; } }