/** * Sets catch condition node, and sets its parent to this node. * @param catchCondition catch condition node. Can be {@code null}. */ public void setCatchCondition(AstNode catchCondition) { this.catchCondition = catchCondition; if (catchCondition != null) catchCondition.setParent(this); }
/** * Sets the case expression, {@code null} for default case. * Note that for empty fall-through cases, they still have * a case expression. In {@code case 0: case 1: break;} the * first case has an {@code expression} that is a * {@link NumberLiteral} with value {@code 0}. */ public void setExpression(AstNode expression) { this.expression = expression; if (expression != null) expression.setParent(this); }
/** * Sets finally block, and sets its parent to this node. * May be {@code null}. */ public void setFinallyBlock(AstNode finallyBlock) { this.finallyBlock = finallyBlock; if (finallyBlock != null) finallyBlock.setParent(this); }
/** * Sets the case expression, {@code null} for default case. * Note that for empty fall-through cases, they still have * a case expression. In {@code case 0: case 1: break;} the * first case has an {@code expression} that is a * {@link NumberLiteral} with value {@code 0}. */ public void setExpression(AstNode expression) { this.expression = expression; if (expression != null) expression.setParent(this); }
/** * Sets catch condition node, and sets its parent to this node. * @param catchCondition catch condition node. Can be {@code null}. */ public void setCatchCondition(AstNode catchCondition) { this.catchCondition = catchCondition; if (catchCondition != null) catchCondition.setParent(this); }
/** * Sets filter expression, and sets its parent to this node. * Can be {@code null}. */ public void setFilter(AstNode filter) { this.filter = filter; if (filter != null) filter.setParent(this); }
/** * Sets filter expression, and sets its parent to this node. * Can be {@code null}. */ public void setFilter(AstNode filter) { this.filter = filter; if (filter != null) filter.setParent(this); }
/** * Sets the operand, and sets its parent to be this node. * @throws IllegalArgumentException} if {@code operand} is {@code null} */ public void setOperand(AstNode operand) { assertNotNull(operand); this.operand = operand; operand.setParent(this); }
/** * Sets loop condition, and sets its parent to this node. * @throws IllegalArgumentException if condition is null */ public void setCondition(AstNode condition) { assertNotNull(condition); this.condition = condition; condition.setParent(this); }
/** * Sets result expression, and sets its parent to this node. * @throws IllegalArgumentException if result is {@code null} */ public void setResult(AstNode result) { assertNotNull(result); this.result = result; result.setParent(this); }
/** * Sets object being iterated over, and sets its parent to this node. * @throws IllegalArgumentException if {@code object} is {@code null} */ public void setIteratedObject(AstNode object) { assertNotNull(object); this.iteratedObject = object; object.setParent(this); }
/** * Sets loop condition, and sets its parent to this node. * @param condition loop condition. Pass an {@link EmptyExpression} * if the condition is missing. * @throws IllegalArgumentException} if condition is {@code null} */ public void setCondition(AstNode condition) { assertNotNull(condition); this.condition = condition; condition.setParent(this); }
/** * Sets test expression, and sets its parent. * @param testExpression test expression * @throws IllegalArgumentException if testExpression is {@code null} */ public void setTestExpression(AstNode testExpression) { assertNotNull(testExpression); this.testExpression = testExpression; testExpression.setParent(this); }
/** * Sets try block. Also sets its parent to this node. * @throws IllegalArgumentException} if {@code tryBlock} is {@code null} */ public void setTryBlock(AstNode tryBlock) { assertNotNull(tryBlock); this.tryBlock = tryBlock; tryBlock.setParent(this); }
/** * Sets the expression embedded in {}, and sets its parent to this node. * @throws IllegalArgumentException if {@code expression} is {@code null} */ public void setExpression(AstNode expression) { assertNotNull(expression); this.expression = expression; expression.setParent(this); }
/** * Sets node evaluating to the function to call, and sets * its parent to this node. * @param target node evaluating to the function to call. * @throws IllegalArgumentException} if target is {@code null} */ public void setTarget(AstNode target) { assertNotNull(target); this.target = target; target.setParent(this); }
/** * Sets the right-hand side of the expression, and sets its parent to this * node. * @throws IllegalArgumentException} if right is {@code null} */ public void setRight(AstNode right) { assertNotNull(right); this.right = right; right.setParent(this); }
/** * Sets index expression, and sets its parent to this node. * @throws IllegalArgumentException if {@code expr} is {@code null} */ public void setExpression(AstNode expr) { assertNotNull(expr); indexExpr = expr; expr.setParent(this); }
/** * Sets loop condition, and sets its parent to this node. * @param condition loop condition. Pass an {@link EmptyExpression} * if the condition is missing. * @throws IllegalArgumentException} if condition is {@code null} */ public void setCondition(AstNode condition) { assertNotNull(condition); this.condition = condition; condition.setParent(this); }
/** * Sets loop condition * @throws IllegalArgumentException} if condition is {@code null} */ public void setCondition(AstNode condition) { assertNotNull(condition); this.condition = condition; condition.setParent(this); }