Package org.codehaus.groovy.tools.javac

## Class JavaStubCompilationUnit

- java.lang.Object
- - org.codehaus.groovy.control.ProcessingUnit
  - - org.codehaus.groovy.control.CompilationUnit
    - - org.codehaus.groovy.tools.javac.JavaStubCompilationUnit

-     public class JavaStubCompilationUnit
      extends CompilationUnit

  Compilation unit to only generate stubs.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.codehaus.groovy.control.CompilationUnit

      `CompilationUnit.ClassgenCallback, CompilationUnit.GroovyClassOperation, CompilationUnit.IGroovyClassOperation, CompilationUnit.IPrimaryClassNodeOperation, CompilationUnit.ISourceUnitOperation, CompilationUnit.PrimaryClassNodeOperation, CompilationUnit.ProgressCallback, CompilationUnit.SourceUnitOperation`

  - ### Field Summary

    - ### Fields inherited from class org.codehaus.groovy.control.CompilationUnit

      `ast, astTransformationsContext, classgenCallback, classNodeResolver, configured, debug, progressCallback, queuedSources, resolveVisitor, sources`

    - ### Fields inherited from class org.codehaus.groovy.control.ProcessingUnit

      `classLoader, configuration, errorCollector, phase, phaseComplete`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JavaStubCompilationUnit​(CompilerConfiguration config, GroovyClassLoader gcl)` |
    `JavaStubCompilationUnit​(CompilerConfiguration config, GroovyClassLoader gcl, File destDir)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SourceUnit` | `addSource​(File file)` | Adds a source file to the unit.
    `SourceUnit` | `addSource​(URL url)` | Adds a source file to the unit.
    `void` | `compile()` | Synonym for `compile(Phases.ALL)`.
    `void` | `configure​(CompilerConfiguration config)` | Configures its debugging mode and classloader classpath from a given compiler configuration.
    `int` | `getStubCount()` |

    - ### Methods inherited from class org.codehaus.groovy.control.CompilationUnit

      `addClassNode, addFirstPhaseOperation, addFirstPhaseOperation, addJavaCompilationUnits, addNewPhaseOperation, addNewPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addSource, addSource, addSource, addSources, addSources, applyToPrimaryClassNodes, applyToSourceUnits, compile, createClassVisitor, dequeued, getAST, getASTTransformationsContext, getClasses, getClassgenCallback, getClassNode, getClassNodeResolver, getFirstClassNode, getJavaCompilationUnitSet, getProgressCallback, getTransformLoader, iterator, mark, setClassgenCallback, setClassNodeResolver, setProgressCallback`

    - ### Methods inherited from class org.codehaus.groovy.control.ProcessingUnit

      `completePhase, getClassLoader, getConfiguration, getErrorCollector, getPhase, getPhaseDescription, gotoPhase, isPhaseComplete, nextPhase, setClassLoader, setConfiguration`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaStubCompilationUnit

          public JavaStubCompilationUnit​(CompilerConfiguration config,
                                         GroovyClassLoader gcl,
                                         File destDir)

    - #### JavaStubCompilationUnit

          public JavaStubCompilationUnit​(CompilerConfiguration config,
                                         GroovyClassLoader gcl)

  - ### Method Detail

    - #### getStubCount

          public int getStubCount()

    - #### compile

          public void compile()
                       throws CompilationFailedException

      Description copied from class: `CompilationUnit`
      Synonym for `compile(Phases.ALL)`.
      Overrides:
        `compile` in class `CompilationUnit`
      Throws:
        `CompilationFailedException`

    - #### configure

          public void configure​(CompilerConfiguration config)

      Description copied from class: `CompilationUnit`
      Configures its debugging mode and classloader classpath from a given compiler configuration. This cannot be done more than once due to limitations in `URLClassLoader`.
      Overrides:
        `configure` in class `CompilationUnit`

    - #### addSource

          public SourceUnit addSource​(File file)

      Description copied from class: `CompilationUnit`
      Adds a source file to the unit.
      Overrides:
        `addSource` in class `CompilationUnit`

    - #### addSource

          public SourceUnit addSource​(URL url)

      Description copied from class: `CompilationUnit`
      Adds a source file to the unit.
      Overrides:
        `addSource` in class `CompilationUnit`