Class JavaBlock
java.lang.Object
com.regnosys.rosetta.generator.java.statement.JavaStatement
com.regnosys.rosetta.generator.java.statement.JavaBlock
- All Implemented Interfaces:
JavaLambdaBody,TargetLanguageRepresentation
Based on the Java specification: https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Block
Example:
```
{
int x = 42;
return x;
}
```
See `JavaStatement` for more documentation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(JavaStatement other) Append the given statement to this one.voidappendTo(org.eclipse.xtend2.lib.StringConcatenationClient.TargetStringConcatenation target) prepend(JavaStatement other) toBlock()Convert this statement into a block enclosed by curly braces, if this statement is not already a block.
-
Constructor Details
-
JavaBlock
-
-
Method Details
-
appendTo
public void appendTo(org.eclipse.xtend2.lib.StringConcatenationClient.TargetStringConcatenation target) - Specified by:
appendToin interfaceTargetLanguageRepresentation
-
toBlock
Description copied from class:JavaStatementConvert this statement into a block enclosed by curly braces, if this statement is not already a block. For example, given the statement `return x;`, the following block statement will be returned: ``` { return x; } ```- Overrides:
toBlockin classJavaStatement
-
asStatementList
- Overrides:
asStatementListin classJavaStatement
-
prepend
- Overrides:
prependin classJavaStatement
-
append
Description copied from class:JavaStatementAppend the given statement to this one. Behaves the same as `other.prepend(this)`. This operation flattens block statements. Examples: - given the statements `int x = 42;` and `return x;`, appending the latter to the former results in the following block: ``` { int x = 42; return x; } ``` - given a statement `int x = 42;` and a block ``` { int y = x + 1; return y; } ``` appending the latter to the former results in the following block: ``` { int x = 42; int y = x + 1; return y; } ```- Overrides:
appendin classJavaStatement
-
append
-