Class LanguageFeatures

java.lang.Object
org.spongepowered.asm.util.LanguageFeatures

public final class LanguageFeatures extends Object
Bitmask values for language features supported. Contains utility methods for detecting language features in use in supplied class nodes.
  • Field Details

    • METHODS_IN_INTERFACES

      public static final int METHODS_IN_INTERFACES
      Language version supports methods in interfaces
      See Also:
    • PRIVATE_SYNTHETIC_METHODS_IN_INTERFACES

      public static final int PRIVATE_SYNTHETIC_METHODS_IN_INTERFACES
      Language version supports synthetic private methods in interfaces
      See Also:
    • PRIVATE_METHODS_IN_INTERFACES

      public static final int PRIVATE_METHODS_IN_INTERFACES
      Language version supports user-defined private methods in interfaces
      See Also:
    • NESTING

      public static final int NESTING
      Native nesting
      See Also:
    • DYNAMIC_CONSTANTS

      public static final int DYNAMIC_CONSTANTS
      Dynamic constants
      See Also:
    • RECORDS

      public static final int RECORDS
      Record types
      See Also:
    • SEALED_CLASSES

      public static final int SEALED_CLASSES
      Sealed classes (permitted subclasses)
      See Also:
  • Method Details

    • scan

      public static int scan(org.objectweb.asm.tree.ClassNode classNode)
      Scan the supplied class node to determine required language features via heuristic.
      Parameters:
      classNode - ClassNode to scan (must include method bodies for reliable detection)
      Returns:
      detected language features
    • format

      public static final String format(int features)
      Format the supplied feature mask as a plain-text list for use in error messages etc.
      Parameters:
      features - Language features to format
      Returns:
      Formatted list of features