Class VersionUtil

java.lang.Object  extended by com.fasterxml.jackson.core.util.VersionUtil
Direct Known Subclasses:

public class VersionUtil
extends Object

Functionality for supporting exposing of component Versions.

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. In latter case one must sub-class to get proper per-module instance; and sub-class must reside in same Java package as matching "VERSION.txt" file.

Field Summary
static StringVERSION_FILE
Constructor Summary
protected VersionUtil()
Method Summary
static VersionmavenVersionFor(ClassLoader classLoader, String groupId, String artifactId)
          Will attempt to load the maven version for the given groupId and artifactId.
static VersionparseVersion(String versionStr)
static VersionparseVersion(String versionStr, String groupId, String artifactId)
protected static intparseVersionPart(String partStr)
static VersionversionFor(Class<?> cls)
          Helper method that will try to load version information for specified class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String VERSION_FILE
See Also:
Constant Field Values
Constructor Detail


protected VersionUtil()
Method Detail


public Version version()


public static Version versionFor(Class<?> cls)
Helper method that will try to load version information for specified class. Implementation is simple: class loader that loaded specified class is asked to load resource with name "VERSION" from same location (package) as class itself had. If no version information is found, Version.unknownVersion() is returned.


public static Version mavenVersionFor(ClassLoader classLoader,                                      String groupId,                                      String artifactId)
Will attempt to load the maven version for the given groupId and artifactId. Maven puts a file in META-INF/maven/groupId/artifactId, containing the groupId, artifactId and version of the library.

classLoader - the ClassLoader to load the file from
groupId - the groupId of the library
artifactId - the artifactId of the library
The version


@Deprecatedpublic static Version parseVersion(String versionStr)

Use variant that takes three arguments instead


public static Version parseVersion(String versionStr,                                   String groupId,                                   String artifactId)


protected static int parseVersionPart(String partStr)

Copyright © 2012 All Rights Reserved.

Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14