Klasse RequiresDirective


public class RequiresDirective extends ModuleDirective
Requires directive AST node type (added in JLS9 API).
 RequiresDirective:
     requires { ModuleModifier } Name ;
 
Seit:
3.14
  • Felddetails

  • Methodendetails

    • propertyDescriptors

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

      public List modifiers()
      Returns the live ordered list of modifiers of this declaration.

      Note that the not all modifiers are legal.

      Gibt zurück:
      the live list of module modifiers (element type: ModuleModifier)
    • getModifiers

      public int getModifiers()
      Returns the module modifiers explicitly specified on this declaration.

      This method is a convenience method that computes these flags from modifiers().

      Gibt zurück:
      the bit-wise or of ModuleModifier constants
      Siehe auch:
    • getName

      public Name getName()
      Returns the module name referenced by this declaration.
      Gibt zurück:
      the module referenced
    • setName

      public void setName(Name name)
      Sets the module name in requires directive to the given name.
      Parameter:
      name - the new module name
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent