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.
Note that method for accessing version information changed between versions 2.1 and 2.2; earlier code used file named "VERSION.txt"; but this has serious performance issues on some platforms (Android), so a replacement system was implemented to use class generation and dynamic class loading.
Note that functionality for reading "VERSION.txt" was removed completely from Jackson 2.6.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static final void | |
| public static Version | Returns: The versionthe ClassLoader to load the pom.properties file from cl, String the groupId of the library groupId, String the artifactId of the library artifactId)
Deprecated
Since 2.6: functionality not used by any official Jackson component, should be
moved out if anyone needs it
Will attempt to load the maven version for the given groupId and
artifactId.
|
| public static Version | Returns: Version information discovered if any;Version#unknownVersion() if noneClass for which to look version information cls)
Deprecated
Since 2.12 simply use
Alias of versionFor(Class) instead
versionFor(Class).
|
| 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 |
| protected static int | |
| public static final void | |
| public static final <T> T | |
| public Version | |
| 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() | |
| _close | back to summary |
|---|---|
| private static final void _close(Closeable c) | |
| mavenVersionFor | back to summary |
|---|---|
| public static Version mavenVersionFor(ClassLoader cl, String groupId, String artifactId)
Deprecated Since 2.6: functionality not used by any official Jackson component, should be moved out if anyone needs it Will attempt to load the maven version for the given groupId and artifactId. Maven puts a pom.properties file in META-INF/maven/groupId/artifactId, containing the groupId, artifactId and version of the library.
| |
| packageVersionFor | back to summary |
|---|---|
| public static Version packageVersionFor(Class<?> cls)
Deprecated Since 2.12 simply use Alias of
| |
| parseVersion | back to summary |
|---|---|
| public static Version parseVersion(String s, String groupId, String artifactId) Method used by
| |
| parseVersionPart | back to summary |
|---|---|
| protected static int parseVersionPart(String s) | |
| throwInternal | back to summary |
|---|---|
| public static final void throwInternal() | |
| throwInternalReturnAny | back to summary |
|---|---|
| public static final <T> T throwInternalReturnAny() | |
| version | back to summary |
|---|---|
| public Version version()
Deprecated
| |
| 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"
| |