Class ModuleModifier

java.lang.Object
org.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.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 Details

    • KEYWORD_PROPERTY

      public static final SimplePropertyDescriptor KEYWORD_PROPERTY
      The "keyword" structural property of this node type (type: ModuleModifier.ModuleModifierKeyword).
    • NONE

      public static final int NONE
      Module Modifier constant (bit mask, value 0) indicating no module modifiers.
      See Also:
    • 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:
    • TRANSITIVE

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

    • 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)
    • getKeyword

      Returns the modifier keyword of this modifier node.
      Returns:
      the modifier keyword
    • setKeyword

      public void setKeyword(ModuleModifier.ModuleModifierKeyword modifierKeyord)
      Sets the module modifier keyword of this module modifier node.
      Parameters:
      modifierKeyord - the module modifier keyword
      Throws:
      IllegalArgumentException - if the argument is null
    • 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