Class ASM


  • public final class ASM
    extends java.lang.Object
    Utility methods for determining ASM version and other version-specific shenanigans
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int API_VERSION
      The detected ASM API Version
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getApiVersionMajor()
      Get the major API version
      static int getApiVersionMinor()
      Get the minor API version
      static java.lang.String getApiVersionString()
      Get the ASM API version as a string (mostly for debugging)
      static java.lang.String getClassVersionString()
      Get the supported java version as a string (mostly for the banner)
      static int getMaxSupportedClassVersion()
      Get the maximum supported class version (raw)
      static int getMaxSupportedClassVersionMajor()
      Get the maximum supported major class versior
      static int getMaxSupportedClassVersionMinor()
      Get the maximum supported minor class versior
      static java.lang.String getVersionString()
      Get the ASM version as a string (mostly for debugging and the banner)
      static boolean isAtLeastVersion​(int majorVersion)
      Get whether the current ASM API is at least the specified version
      static boolean isAtLeastVersion​(int majorVersion, int minorVersion)
      Get whether the current ASM API is at least the specified version (including minor version when it's relevant)
      static boolean isAtLeastVersion​(int majorVersion, int minorVersion, int patchVersion)
      Get whether the current ASM API is at least the specified version (including minor version and patch version when it's relevant)
      • Methods inherited from class java.lang.Object

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

      • API_VERSION

        public static final int API_VERSION
        The detected ASM API Version
    • Method Detail

      • isAtLeastVersion

        public static boolean isAtLeastVersion​(int majorVersion)
        Get whether the current ASM API is at least the specified version
        Parameters:
        majorVersion - version to check for (eg. 6)
      • isAtLeastVersion

        public static boolean isAtLeastVersion​(int majorVersion,
                                               int minorVersion)
        Get whether the current ASM API is at least the specified version (including minor version when it's relevant)
        Parameters:
        majorVersion - major version to check for (eg. 6)
        minorVersion - minor version to check for
      • isAtLeastVersion

        public static boolean isAtLeastVersion​(int majorVersion,
                                               int minorVersion,
                                               int patchVersion)
        Get whether the current ASM API is at least the specified version (including minor version and patch version when it's relevant)
        Parameters:
        majorVersion - major version to check for (eg. 6)
        minorVersion - minor version to check for
        patchVersion - patch version to check for
      • getApiVersionMajor

        public static int getApiVersionMajor()
        Get the major API version
      • getApiVersionMinor

        public static int getApiVersionMinor()
        Get the minor API version
      • getApiVersionString

        public static java.lang.String getApiVersionString()
        Get the ASM API version as a string (mostly for debugging)
        Returns:
        ASM API version as string
      • getVersionString

        public static java.lang.String getVersionString()
        Get the ASM version as a string (mostly for debugging and the banner)
        Returns:
        ASM library version as string
      • getMaxSupportedClassVersion

        public static int getMaxSupportedClassVersion()
        Get the maximum supported class version (raw)
      • getMaxSupportedClassVersionMajor

        public static int getMaxSupportedClassVersionMajor()
        Get the maximum supported major class versior
      • getMaxSupportedClassVersionMinor

        public static int getMaxSupportedClassVersionMinor()
        Get the maximum supported minor class versior
      • getClassVersionString

        public static java.lang.String getClassVersionString()
        Get the supported java version as a string (mostly for the banner)
        Returns:
        Java class supported version as string