Package io.micronaut.sourcegen.model
Interface StatementDef
- All Known Implementing Classes:
ExpressionDef.InvokeInstanceMethod
,ExpressionDef.InvokeStaticMethod
,StatementDef.Assign
,StatementDef.DefineAndAssign
,StatementDef.If
,StatementDef.IfElse
,StatementDef.Multi
,StatementDef.PutField
,StatementDef.PutStaticField
,StatementDef.Return
,StatementDef.Switch
,StatementDef.Synchronized
,StatementDef.Throw
,StatementDef.Try
,StatementDef.While
public sealed interface StatementDef
permits ExpressionDef.InvokeInstanceMethod, ExpressionDef.InvokeStaticMethod, StatementDef.Assign, StatementDef.DefineAndAssign, StatementDef.If, StatementDef.IfElse, StatementDef.Multi, StatementDef.PutField, StatementDef.PutStaticField, StatementDef.Return, StatementDef.Switch, StatementDef.Synchronized, StatementDef.Throw, StatementDef.Try, StatementDef.While
The statement definition.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
The assign statement.static final record
The local variable definition and assignment statement.static final record
The if statement.static final record
The if-else statement.static final record
The multi statement.static final record
The put field expression.static final record
The set a static field expression.static final record
The return statement.static final record
The switch statement.static final record
The synchronized statement.static final record
The throw statement.static final record
The try statement.static final record
The while statement. -
Method Summary
Modifier and TypeMethodDescriptiondefault StatementDef
after
(StatementDef statement) The helper method to turn this statement into a multi statement.default StatementDef.Try
doTry()
Try statement.static StatementDef.Try
doTry
(StatementDef statement) Try statement.default List<StatementDef>
flatten()
Flatten the collection.static StatementDef
multi
(@NonNull StatementDef... statements) The multi line statement.static StatementDef
multi
(@NonNull List<StatementDef> statements) The multi line statement.
-
Method Details
-
after
The helper method to turn this statement into a multi statement.- Parameters:
statement
- statement- Returns:
- statement
- Since:
- 1.2
-
flatten
Flatten the collection.- Returns:
- all the statements
- Since:
- 1.2
-
doTry
Try statement.- Returns:
- The try statement
- Since:
- 1.5
-
doTry
Try statement.- Parameters:
statement
- The statement to try- Returns:
- The try statement
- Since:
- 1.5
-
multi
The multi line statement.- Parameters:
statements
- statements- Returns:
- statement
- Since:
- 1.2
-
multi
The multi line statement.- Parameters:
statements
- statements- Returns:
- statement
- Since:
- 1.2
-