Package: org.codehaus.groovy.ast.stmt

## [Java] Class EmptyStatement

- org.codehaus.groovy.ast.stmt.EmptyStatement

-     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.

  See Also:
    Statement
    SwitchStatement

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and description
    `EmptyStatement()` Constructs a new empty statement instance.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `isEmpty()`
    `` | `public void` | `visit(GroovyCodeVisitor visitor)`

  - ### Inherited Methods Summary

    Inherited Methods
    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`

- - ### Field Detail

    - #### public static final EmptyStatement INSTANCE

      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.

      See Also:
        EmptyStatement.EmptyStatement

  - ### Constructor Detail

    - #### public EmptyStatement()

      Constructs a new empty statement instance. For most use cases, consider using INSTANCE instead to avoid unnecessary object allocation.

      See Also:
        INSTANCE

  - ### Method Detail

    - #### public boolean isEmpty()

    - #### public void visit(GroovyCodeVisitor visitor)