Package org.spongepowered.asm.util
Class LanguageFeatures
java.lang.Object
org.spongepowered.asm.util.LanguageFeatures
Bitmask values for language features supported. Contains utility methods for
detecting language features in use in supplied class nodes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDynamic constantsstatic final intLanguage version supports methods in interfacesstatic final intNative nestingstatic final intLanguage version supports user-defined private methods in interfacesstatic final intLanguage version supports synthetic private methods in interfacesstatic final intRecord typesstatic final intSealed classes (permitted subclasses) -
Method Summary
Modifier and TypeMethodDescriptionstatic final Stringformat(int features) Format the supplied feature mask as a plain-text list for use in error messages etc.static intscan(org.objectweb.asm.tree.ClassNode classNode) Scan the supplied class node to determine required language features via heuristic.
-
Field Details
-
METHODS_IN_INTERFACES
public static final int METHODS_IN_INTERFACESLanguage version supports methods in interfaces- See Also:
-
PRIVATE_SYNTHETIC_METHODS_IN_INTERFACES
public static final int PRIVATE_SYNTHETIC_METHODS_IN_INTERFACESLanguage version supports synthetic private methods in interfaces- See Also:
-
PRIVATE_METHODS_IN_INTERFACES
public static final int PRIVATE_METHODS_IN_INTERFACESLanguage version supports user-defined private methods in interfaces- See Also:
-
NESTING
public static final int NESTINGNative nesting- See Also:
-
DYNAMIC_CONSTANTS
public static final int DYNAMIC_CONSTANTSDynamic constants- See Also:
-
RECORDS
public static final int RECORDSRecord types- See Also:
-
SEALED_CLASSES
public static final int SEALED_CLASSESSealed 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
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
-