Klasse EnhancedForWithRecordPattern


public class EnhancedForWithRecordPattern extends Statement
Enhanced For statement AST node type with record pattern(added in JLS20 API).
 EnhancedForStatement:
    for ( RecordPattern : Expression )
                        Statement
 
Seit:
3.33
  • 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)
    • getPattern

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

      public void setPattern(RecordPattern pattern)
      Sets the record pattern in this enhanced for statement.
      Parameter:
      pattern - the new record pattern
      Löst aus:
      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.
      Gibt zurück:
      the expression node
    • setExpression

      public void setExpression(Expression expression)
      Sets the expression of this enhanced for statement.
      Parameter:
      expression - the new expression node
      Löst aus:
      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.
      Gibt zurück:
      the body statement node
    • setBody

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