Class LanguageFeatures


  • public final class LanguageFeatures
    extends java.lang.Object
    Bitmask values for language features supported. Contains utility methods for detecting language features in use in supplied class nodes.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(int features)
      Format the supplied feature mask as a plain-text list for use in error messages etc.
      static int scan​(org.objectweb.asm.tree.ClassNode classNode)
      Scan the supplied class node to determine required language features via heuristic.
      • Methods inherited from class java.lang.Object

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

      • METHODS_IN_INTERFACES

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

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

        public static final int PRIVATE_METHODS_IN_INTERFACES
        Language version supports user-defined private methods in interfaces
        See Also:
        Constant Field Values
      • DYNAMIC_CONSTANTS

        public static final int DYNAMIC_CONSTANTS
        Dynamic constants
        See Also:
        Constant Field Values
      • SEALED_CLASSES

        public static final int SEALED_CLASSES
        Sealed classes (permitted subclasses)
        See Also:
        Constant Field Values
    • Method Detail

      • 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 java.lang.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