Class ProvidesDirective


public class ProvidesDirective extends ModuleDirective
Provides directive AST node type (added in JLS9 API).
 ProvidesDirective:
     provides Name with Name {, Name } ;
 
Since:
3.14
Restriction:
This class is not intended to be subclassed by clients.
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • NAME_PROPERTY

      public static final ChildPropertyDescriptor NAME_PROPERTY
      The "name" structural property of this node type (child type: Name).
    • IMPLEMENTATIONS_PROPERTY

      public static final ChildListPropertyDescriptor IMPLEMENTATIONS_PROPERTY
      The "implementations" structural property of this node type (element type: Name).
  • Method Details

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

      public Name getName()
      Returns the name of the service in this directive.
      Returns:
      the services name
    • setName

      public void setName(Name name)
      Sets the name of the service.
      Parameters:
      name - the new service name
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
    • implementations

      public List implementations()
      Returns the live ordered list of implementations for the interface in this provides directive.
      Returns:
      the live list of implementations for the interface (element type: Name)