java.lang.Object
com.regnosys.rosetta.generator.java.statement.JavaStatement
com.regnosys.rosetta.generator.java.statement.JavaBlock
All Implemented Interfaces:
JavaLambdaBody, TargetLanguageRepresentation

public class JavaBlock extends JavaStatement implements JavaLambdaBody
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 Details

  • Method Details

    • appendTo

      public void appendTo(org.eclipse.xtend2.lib.StringConcatenationClient.TargetStringConcatenation target)
      Specified by:
      appendTo in interface TargetLanguageRepresentation
    • toBlock

      public JavaBlock toBlock()
      Description copied from class: JavaStatement
      Convert 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:
      toBlock in class JavaStatement
    • asStatementList

      public JavaStatementList asStatementList()
      Overrides:
      asStatementList in class JavaStatement
    • prepend

      public JavaBlock prepend(JavaStatement other)
      Overrides:
      prepend in class JavaStatement
    • append

      public JavaBlock append(JavaStatement other)
      Description copied from class: JavaStatement
      Append 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:
      append in class JavaStatement
    • append

      public JavaBlock append(JavaBlock other)