Class SpringVersionUtils


  • public abstract class SpringVersionUtils
    extends io.microsphere.util.BaseUtils
    The Utilities class for Spring Framework Version
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    SpringVersion, SpringVersion, Version
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.microsphere.util.Version getSpringVersion​(java.lang.Class<?> springClass)
      Get the Version from the Spring class
      static io.microsphere.util.Version getSpringVersion​(java.lang.String springClassName)
      Get the Version from the Spring class
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SPRING_BASE_PACKAGE_NAME

        public static final java.lang.String SPRING_BASE_PACKAGE_NAME
        See Also:
        Constant Field Values
      • SPRING_CORE_VERSION

        @Nonnull
        public static final io.microsphere.util.Version SPRING_CORE_VERSION
        The version of "spring-core" module
      • SPRING_AOP_VERSION

        @Nullable
        public static final io.microsphere.util.Version SPRING_AOP_VERSION
        The version of "spring-aop" module
      • SPRING_BEANS_VERSION

        @Nonnull
        public static final io.microsphere.util.Version SPRING_BEANS_VERSION
        The version of "spring-beans" module
      • SPRING_CONTEXT_VERSION

        @Nonnull
        public static final io.microsphere.util.Version SPRING_CONTEXT_VERSION
        The version of "spring-context" module
      • SPRING_CONTEXT_SUPPORT_VERSION

        @Nullable
        public static final io.microsphere.util.Version SPRING_CONTEXT_SUPPORT_VERSION
        The version of "spring-context-support" module
    • Constructor Detail

      • SpringVersionUtils

        public SpringVersionUtils()
    • Method Detail

      • getSpringVersion

        @Nullable
        public static io.microsphere.util.Version getSpringVersion​(java.lang.String springClassName)
                                                            throws java.lang.NullPointerException,
                                                                   java.lang.IllegalArgumentException
        Get the Version from the Spring class
        Parameters:
        springClassName - the Spring class name
        Returns:
        null of the specified class can't be found by its' name the "Implementation-Version" attribute is absent in the "META-INF/MANIFEST.MF" resource
        Throws:
        java.lang.NullPointerException - if springClass is null
        java.lang.IllegalArgumentException - if the package name of springClass does not start with "org.springframework"
        java.lang.IllegalStateException - if the "Implementation-Version" attribute is absent in the "META-INF/MANIFEST.MF" resource
      • getSpringVersion

        @Nonnull
        public static io.microsphere.util.Version getSpringVersion​(java.lang.Class<?> springClass)
                                                            throws java.lang.NullPointerException,
                                                                   java.lang.IllegalArgumentException
        Get the Version from the Spring class
        Parameters:
        springClass - the Spring class
        Returns:
        non-null
        Throws:
        java.lang.NullPointerException - if springClass is null
        java.lang.IllegalArgumentException - if the package name of springClass does not start with "org.springframework"
        java.lang.IllegalStateException - if the "Implementation-Version" attribute is absent in the "META-INF/MANIFEST.MF" resource