Class EnhancedForWithRecordPattern

java.lang.Object
org.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.Statement
org.eclipse.jdt.core.dom.EnhancedForWithRecordPattern

public class EnhancedForWithRecordPattern extends Statement
Enhanced For statement AST node type with record pattern(added in JLS20 API).
 EnhancedForStatement:
    for ( RecordPattern : Expression )
                        Statement
 
Since:
3.33
Restriction:
This class is not intended to be referenced by clients.
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

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

      public RecordPattern getPattern()
      Returns the record pattern in this enhanced for statement.
      Returns:
      the pattern
    • setPattern

      public void setPattern(RecordPattern pattern)
      Sets the record pattern in this enhanced for statement.
      Parameters:
      pattern - the new record pattern
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
    • getExpression

      public Expression getExpression()
      Returns the expression of this enhanced for statement.
      Returns:
      the expression node
    • setExpression

      public void setExpression(Expression expression)
      Sets the expression of this enhanced for statement.
      Parameters:
      expression - the new expression node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
    • getBody

      public Statement getBody()
      Returns the body of this enchanced for statement.
      Returns:
      the body statement node
    • setBody

      public void setBody(Statement statement)
      Sets the body of this enhanced for statement.
      Parameters:
      statement - the body statement node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created