Class ModulePackageAccess

Direct Known Subclasses:
ExportsDirective, OpensDirective

public abstract class ModulePackageAccess extends ModuleDirective
Abstract base class of AST nodes that represent exports and opens directives (added in JLS9 API).
 ModulePackageAccess:
    ExportsDirective
    OpensDirective
 
Since:
3.14
Restriction:
This class is not intended to be subclassed by clients.
  • Field Details

    • name

      protected Name name
      The package name; lazily initialized; defaults to a unspecified, legal Java identifier.
    • modules

      protected org.eclipse.jdt.core.dom.ASTNode.NodeList modules
      The target modules (element type: Name). Defaults to an empty list. (see constructor)
  • Method Details

    • getNameProperty

      public final ChildPropertyDescriptor getNameProperty()
      Returns structural property descriptor for the "name" property of this node (child type: Name).
      Returns:
      the property descriptor
    • getName

      public Name getName()
      Returns the name of the package.
      Returns:
      the package name node
    • setName

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

      public List modules()
      Returns the live ordered list of target modules for this directive.
      Returns:
      the live list of target modules (element type: Name)
    • cloneHelper

      protected ASTNode cloneHelper(AST target, ModulePackageAccess result)
    • acceptVisitChildren

      protected void acceptVisitChildren(boolean visitChildren, ASTVisitor visitor)