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
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe assign statement.static final recordThe local variable definition and assignment statement.static final recordThe if statement.static final recordThe if-else statement.static final recordThe multi statement.static final recordThe put field expression.static final recordThe set a static field expression.static final recordThe return statement.static final recordThe switch statement.static final recordThe synchronized statement.static final recordThe throw statement.static final recordThe try statement.static final recordThe while statement. -
Method Summary
Modifier and TypeMethodDescriptiondefault StatementDefafter(StatementDef statement) The helper method to turn this statement into a multi statement.default StatementDef.TrydoTry()Try statement.static StatementDef.TrydoTry(StatementDef statement) Try statement.default List<StatementDef>flatten()Flatten the collection.static StatementDefmulti(@NonNull StatementDef... statements) The multi line statement.static StatementDefmulti(@NonNull List<StatementDef> statements) The multi line statement.Stream<? extends ExpressionDef>Stream of nested expressions included in this 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
-
nestedExpressionsStream
Stream<? extends ExpressionDef> nestedExpressionsStream()Stream of nested expressions included in this statement.- Returns:
- all the expressions
- Since:
- 1.7
-
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
-