public static class AssertStatementCreationUtility.ReturnStatementVisitor
extends ClassCodeVisitorSupport
Collects all ReturnStatement instances from a given code block.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public List<ReturnStatement> |
getReturnStatements()Returns the collected return statements. |
|
protected SourceUnit |
getSourceUnit()This visitor is source-independent. |
|
public void |
visitClosureExpression(ClosureExpression expression)Skips nested closures so only returns from the surrounding method are collected. |
|
public void |
visitReturnStatement(ReturnStatement statement)Records one visited return statement. |
Returns the collected return statements.
This visitor is source-independent.
nullSkips nested closures so only returns from the surrounding method are collected.
expression - the closure expression to ignoreRecords one visited return statement.
statement - the return statement to collect