Top Description Fields Constructors Methods
tools.jackson.core.util

public Class VersionUtil

extends Object
Class Inheritance
Imports
java.util.regex.Pattern, tools.jackson.core.Version, .Versioned

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.

Field Summary

Modifier and TypeField and Description
private static final Pattern

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static Version

Returns:

Version instance constructed from parsed components, if successful; Version#unknownVersion() if parsing of components fail
parseVersion
(String
Version 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 PackageVersion classes to decode version injected by Maven build.

public static int
public static final void
public static final <T> T
public static Version

Returns:

Version information discovered if any; Version#unknownVersion() if none
versionFor
(Class<?>
Class for which to look version information
cls
)

Loads version information by introspecting a class named "PackageVersion" in the same package as the given class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

V_SEPback to summary
private static final Pattern V_SEP

Constructor Detail

VersionUtilback to summary
protected VersionUtil()

Method Detail

parseVersionback to summary
public static Version parseVersion(String s, String groupId, String artifactId)

Method used by PackageVersion classes to decode version injected by Maven build.

Parameters
s:String

Version String to parse

groupId:String

Maven group id to include with version

artifactId:String

Maven artifact id to include with version

Returns:Version

Version instance constructed from parsed components, if successful; Version#unknownVersion() if parsing of components fail

parseVersionPartback to summary
public static int parseVersionPart(String s)
throwInternalback to summary
public static final void throwInternal()
throwInternalReturnAnyback to summary
public static final <T> T throwInternalReturnAny()
versionForback 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" Version returned by Version#unknownVersion().

Parameters
cls:Class<?>

Class for which to look version information

Returns:Version

Version information discovered if any; Version#unknownVersion() if none