java.lang.Object
tools.jackson.core.util.VersionUtil
Functionality for supporting exposing of component
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VersionparseVersion(String s, String groupId, String artifactId) Method used byPackageVersionclasses to decode version injected by Maven build.static intstatic final voidstatic final <T> Tstatic VersionversionFor(Class<?> cls) Loads version information by introspecting a class named "PackageVersion" in the same package as the given class.
-
Constructor Details
-
VersionUtil
protected VersionUtil()
-
-
Method Details
-
versionFor
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"
Versionreturned byVersion.unknownVersion().- Parameters:
cls- Class for which to look version information- Returns:
- Version information discovered if any;
Version.unknownVersion()if none
-
parseVersion
Method used byPackageVersionclasses to decode version injected by Maven build.- Parameters:
s- Version String to parsegroupId- Maven group id to include with versionartifactId- Maven artifact id to include with version- Returns:
- Version instance constructed from parsed components, if successful;
Version.unknownVersion()if parsing of components fail
-
parseVersionPart
-
throwInternal
public static final void throwInternal() -
throwInternalReturnAny
public static final <T> T throwInternalReturnAny()
-