Class ArrayAccess


public class ArrayAccess extends Expression
Array access expression AST node type.
 ArrayAccess:
    Expression [ Expression ]
 
Since:
2.0
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)
      Since:
      3.0
    • getArray

      public Expression getArray()
      Returns the array expression of this array access expression.
      Returns:
      the array expression node
    • setArray

      public void setArray(Expression expression)
      Sets the array expression of this array access expression.
      Parameters:
      expression - the array expression node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
    • getIndex

      public Expression getIndex()
      Returns the index expression of this array access expression.
      Returns:
      the index expression node
    • setIndex

      public void setIndex(Expression expression)
      Sets the index expression of this array access expression.
      Parameters:
      expression - the index expression node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created