Class ModuleModifier


  • public final class ModuleModifier
    extends ASTNode
    Module Modifier node - represents the modifiers for the requires directive in module declaration (added in JLS9 API).
     ModuleModifier:
        static
        transitive
     

    The numeric values of these flags match the ones for class files as described in the Java Virtual Machine Specification. Note that the value of static does not correspond to the value of Modifier.STATIC!

    Since:
    3.14
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Detail

      • NONE

        public static final int NONE
        Module Modifier constant (bit mask, value 0) indicating no module modifiers.
        See Also:
        Constant Field Values
      • STATIC_PHASE

        public static final int STATIC_PHASE
        "static" module modifier constant (bit mask). Applicable to requires directive.

        Note that the value of static does not correspond to the value of Modifier.STATIC!

        See Also:
        Constant Field Values
      • TRANSITIVE

        public static final int TRANSITIVE
        "transitive" module modifier constant (bit mask). Applicable only to requires directive.
        See Also:
        Constant Field Values
    • Method Detail

      • isTransitive

        public static boolean isTransitive​(int flags)
        Returns whether the given flags includes the "transitive" module modifier.
        Parameters:
        flags - the module modifier flags
        Returns:
        true if the TRANSITIVE bit is set, and false otherwise
      • isStatic

        public static boolean isStatic​(int flags)
        Returns whether the given flags includes the "static" module modifier.
        Parameters:
        flags - the module modifier flags
        Returns:
        true if the STATIC bit is set, and false otherwise
      • propertyDescriptors

        public static List propertyDescriptors​(int apiLevel)
        Returns a list of structural property descriptors for this node type. Clients must not modify the result.
        Parameters:
        apiLevel - the API level; one of the AST.JLS* constants
        Returns:
        a list of property descriptors (element type: StructuralPropertyDescriptor)
      • isStatic

        public boolean isStatic()
        Answer true if the receiver is the static module modifier, false otherwise.
        Returns:
        true if the receiver is the static module modifier, false otherwise
      • isTransitive

        public boolean isTransitive()
        Answer true if the receiver is the transitive module modifier, false otherwise.
        Returns:
        true if the receiver is the transitive module modifier, false otherwise