public class StatementModel extends CodeModel
Modifier and Type | Class and Description |
---|---|
static class |
StatementModel.Expression
Marker class for the _default_ statement model.
|
Constructor and Description |
---|
StatementModel() |
Modifier and Type | Method and Description |
---|---|
static StatementModel |
conditional(Consumer<CodeWriter> c)
Creates a
StatementModel for a conditional structure (for loop, while loop...). |
static StatementModel |
conditionals(List<ConditionalBlockModel> conditionals,
StatementModel otherwise)
Creates a
StatementModel for an 'if-then-else' conditional structure. |
static StatementModel |
render(Consumer<CodeWriter> c)
Creates an
StatementModel.Expression from the given code. |
static StatementModel |
render(String s)
Creates an
StatementModel.Expression from the given code. |
render, unsupported
public static StatementModel conditionals(List<ConditionalBlockModel> conditionals, StatementModel otherwise)
StatementModel
for an 'if-then-else' conditional structure.
The returned statement is not an StatementModel.Expression
.conditionals
- the conditionalsotherwise
- the 'else' partpublic static StatementModel conditional(Consumer<CodeWriter> c)
StatementModel
for a conditional structure (for loop, while loop...).
The returned statement is not an StatementModel.Expression
.c
- the code of the structure.public static StatementModel render(Consumer<CodeWriter> c)
StatementModel.Expression
from the given code.c
- the codepublic static StatementModel render(String s)
StatementModel.Expression
from the given code.s
- the codeCopyright © 2018. All rights reserved.