Versions.
Also contains other misc methods that have no other place to live in.
Note that this class can be used in two roles: first, as a static utility class for loading purposes, and second, as a singleton loader of per-module version information.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static Version | Returns: Version instance constructed from parsed components, if successful;Version#unknownVersion() if parsing of components failVersion String to parse s, String Maven group id to include with version groupId, String Maven artifact id to include with version artifactId)Method used by |
| public static int | |
| public static final void | |
| public static final <T> T | |
| public static Version | Returns: Version information discovered if any;Version#unknownVersion() if noneClass for which to look version information cls)Loads version information by introspecting a class named "PackageVersion" in the same package as the given class. |
| V_SEP | back to summary |
|---|---|
| private static final Pattern V_SEP | |
| VersionUtil | back to summary |
|---|---|
| protected VersionUtil() | |
| parseVersion | back to summary |
|---|---|
| public static Version parseVersion(String s, String groupId, String artifactId) Method used by
| |
| parseVersionPart | back to summary |
|---|---|
| public static int parseVersionPart(String s) | |
| throwInternal | back to summary |
|---|---|
| public static final void throwInternal() | |
| throwInternalReturnAny | back to summary |
|---|---|
| public static final <T> T throwInternalReturnAny() | |
| versionFor | back to summary |
|---|---|
| public static Version versionFor(Class<?> cls) Loads version information by introspecting a class named "PackageVersion" in the same package as the given class.
If the class could not be found or does not have a public
static Version field named "VERSION", returns "empty"
| |