Package: org.codehaus.groovy.control

## [Java] Interface CompilationUnit.IPrimaryClassNodeOperation

- org.codehaus.groovy.control.CompilationUnit.PhaseOperation

- All Superinterfaces:
    CompilationUnit.PhaseOperation

      @FunctionalInterface
      public interface CompilationUnit.IPrimaryClassNodeOperation
      extends CompilationUnit.PhaseOperation

  Performs an operation for each primary class node in the compilation.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `call(SourceUnit source, GeneratorContext context, ClassNode classNode)` Performs the operation for one primary class node.
    `` | `public void` | `doPhaseOperation(CompilationUnit unit)` A loop driver for applying operations to all primary ClassNodes in our AST.
    `` | `public boolean` | `needSortedInput()` Indicates whether primary classes should be sorted before visiting.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface CompilationUnit.PhaseOperation` | `doPhaseOperation`

- - ### Method Detail

    - #### public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)

      Performs the operation for one primary class node.

      throws:
        CompilationFailedException if processing fails
      Parameters:
        `source` - the source unit owning the class, or `null` when the class node was supplied directly via CompilationUnit.addClassNode and so has no originating source. Implementations must tolerate `null` here: an unguarded dereference is reported as a GroovyBugError wrapping the `NullPointerException`, which reads as a compiler bug rather than as a fault in the implementation.
        `context` - the current generator context
        `classNode` - the class node to process

    - #### public void doPhaseOperation(CompilationUnit unit)

      A loop driver for applying operations to all primary ClassNodes in our AST. Automatically skips units that have already been processed through the current phase.

    - #### public boolean needSortedInput()

      Indicates whether primary classes should be sorted before visiting.

      Returns:
        `true` if sorted input is required