public static class AssertStatementCreationUtility.AddResultReturnStatementVisitor
extends ClassCodeVisitorSupport
Replaces a given ReturnStatement with the appropriate assertion call statement and returns a result variable expression.
| Constructor and description |
|---|
AddResultReturnStatementVisitor(ReturnStatement returnStatement, ClassNode returnType, BlockStatement assertionCallBlock)Creates a visitor that rewrites one return statement to expose the result variable. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected SourceUnit |
getSourceUnit()This visitor is source-independent. |
|
public void |
visitBlockStatement(BlockStatement block)Rewrites the block containing the target return statement. |
Creates a visitor that rewrites one return statement to expose the result variable.
returnStatement - the return statement to replacereturnType - the declared return typeassertionCallBlock - the assertion block to inject before returningThis visitor is source-independent.
nullRewrites the block containing the target return statement.
block - the block being visitedCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.