public final class Blocks extends Object
Helper methods concerning BlockStatements.
BlockBuilder| Modifier | Constructor and Description |
|---|---|
private |
Blocks() |
| Modifier and Type | Method and Description |
|---|---|
static BlockStatement |
create(Statement statement,
BlockStatement block)
Prepends a statement to a block.
|
static Expression |
simple(BlockStatement block)
Converts a simple "{ return expr; }" block into "expr"; otherwise
throws.
|
static BlockStatement |
toBlock(Node body) |
static BlockStatement |
toFunctionBlock(Node body) |
private static BlockStatement |
toFunctionBlock(Node body,
boolean function) |
private static BlockStatement toFunctionBlock(Node body, boolean function)
public static BlockStatement toFunctionBlock(Node body)
public static BlockStatement toBlock(Node body)
public static BlockStatement create(Statement statement, BlockStatement block)
public static Expression simple(BlockStatement block)
Copyright © 2012–2023 The Apache Software Foundation. All rights reserved.