public class EmptyStatement
extends Statement
Represents an empty statement that performs no operation. An empty statement is a valid statement that can appear wherever a statement is expected but has no executable code. Empty statements are often used as default cases or as placeholders in control flow structures.
An immutable singleton INSTANCE is provided for use when source position or other occurrence-specific metadata is not needed. Using the singleton reduces memory overhead.
| Modifiers | Name | Description |
|---|---|---|
static EmptyStatement |
INSTANCE |
Immutable singleton that is recommended for use when source range or any other occurrence-specific metadata is not needed. |
| Constructor and description |
|---|
EmptyStatement()Constructs a new empty statement instance. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
isEmpty() |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class Statement |
addStatementAnnotation, addStatementLabel, copyStatementLabels, getStatementAnnotations, getStatementLabel, getStatementLabels, isEmpty, setStatementLabel |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Immutable singleton that is recommended for use when source range or any other occurrence-specific metadata is not needed. Using this singleton conserves memory by avoiding unnecessary object allocations.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.