Class PatternInstanceofExpression

java.lang.Object
org.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.Expression
org.eclipse.jdt.core.dom.PatternInstanceofExpression

public class PatternInstanceofExpression extends Expression
PatternInstanceof expression AST node type.
 PatternInstanceofExpression:
    Expression instanceof Variable
 PatternInstanceofExpression:
    Expression instanceof Pattern
 
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • LEFT_OPERAND_PROPERTY

      public static final ChildPropertyDescriptor LEFT_OPERAND_PROPERTY
      The "leftOperand" structural property of this node type (child type: Expression).
    • RIGHT_OPERAND_PROPERTY

      public static final ChildPropertyDescriptor RIGHT_OPERAND_PROPERTY
      Deprecated.
      use pattern property instead from Java 20 onwards
      The "rightOperand" structural property of this node type (child type: SingleVariableDeclaration).
    • PATTERN_PROPERTY

      public static final ChildPropertyDescriptor PATTERN_PROPERTY
      The "pattern" structural property of this node type (child type: Pattern).
      Since:
      3.34
  • 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.27
    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel, boolean isPreview)
      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
      isPreview - If Java language preview features are enabled or not
      Returns:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
      Since:
      3.34
    • getLeftOperand

      public Expression getLeftOperand()
      Returns the left operand of this Patterninstanceof expression.
      Returns:
      the left operand node
      Since:
      3.27
    • setLeftOperand

      public void setLeftOperand(Expression expression)
      Sets the left operand of this instanceof expression.
      Parameters:
      expression - the left operand node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
      Since:
      3.27
    • getRightOperand

      public SingleVariableDeclaration getRightOperand()
      Deprecated.
      Returns the right operand of this instanceof expression.
      Returns:
      the right operand node
      Since:
      3.27
    • getPattern

      public Pattern getPattern()
      Returns the pattern of this instanceof expression.
      Returns:
      the pattern
      Since:
      3.34
    • setRightOperand

      public void setRightOperand(SingleVariableDeclaration referenceDeclaration)
      Deprecated.
      Sets the right operand of this instanceof expression.
      Parameters:
      referenceDeclaration - the right operand node
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
      Since:
      3.27
    • setPattern

      public void setPattern(Pattern pattern)
      Sets the right operand of this instanceof expression.
      Parameters:
      pattern - either the type or record pattern
      Throws:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
      Since:
      3.34