Class VersionUtil


  • public class VersionUtil
    extends java.lang.Object
    Functionality for supporting exposing of component Versions.
    Since:
    1.6
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String VERSION_FILE  
    • Constructor Summary

      Constructors 
      Constructor Description
      VersionUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Version parseVersion​(java.lang.String versionStr)  
      protected static int parseVersionPart​(java.lang.String partStr)  
      static Version versionFor​(java.lang.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
    • Constructor Detail

      • VersionUtil

        public VersionUtil()
    • Method Detail

      • versionFor

        public static Version versionFor​(java.lang.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.
      • parseVersion

        public static Version parseVersion​(java.lang.String versionStr)
      • parseVersionPart

        protected static int parseVersionPart​(java.lang.String partStr)