Class SpringVersionUtils

java.lang.Object
io.microsphere.util.BaseUtils
io.microsphere.spring.util.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:
  • Field Details

    • SPRING_BASE_PACKAGE_NAME

      public static final String SPRING_BASE_PACKAGE_NAME
      See Also:
    • 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 Details

    • SpringVersionUtils

      public SpringVersionUtils()
  • Method Details

    • getSpringVersion

      @Nullable public static io.microsphere.util.Version getSpringVersion(String springClassName) throws NullPointerException, 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:
      NullPointerException - if springClass is null
      IllegalArgumentException - if the package name of springClass does not start with "org.springframework"
      IllegalStateException - if the "Implementation-Version" attribute is absent in the "META-INF/MANIFEST.MF" resource
    • getSpringVersion

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