Package: org.codehaus.groovy.tools.javac

## [Java] Class JavaStubGenerator

- org.codehaus.groovy.tools.javac.JavaStubGenerator

-     public class JavaStubGenerator
      extends Object

  Generates Java stub source for Groovy classes during joint compilation.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `JavaStubGenerator(File outputPath)` Creates a stub generator that writes to the supplied output directory using the default charset.
    `JavaStubGenerator(File outputPath, boolean requireSuperResolved, String encoding)` Creates a stub generator with explicit output options.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `clean()` Deletes generated stub files and clears the tracked stub set.
    `` | `public void` | `generateClass(ClassNode classNode)` Generates a Java stub for the supplied class when it is eligible for stub generation.
    `` | `public Set<JavaFileObject>` | `getJavaStubCompilationUnitSet()` Returns the generated in-memory or file-backed Java file objects.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public JavaStubGenerator(File outputPath)

      Creates a stub generator that writes to the supplied output directory using the default charset.

      Parameters:
        `outputPath` - the destination directory, or `null` for in-memory stubs

    - #### public JavaStubGenerator(File outputPath, boolean requireSuperResolved, String encoding)

      Creates a stub generator with explicit output options.

      Parameters:
        `outputPath` - the destination directory, or `null` for in-memory stubs
        `requireSuperResolved` - whether generation should wait until the superclass is resolved
        `encoding` - the source encoding to use for generated files

  - ### Method Detail

    - #### public void clean()

      Deletes generated stub files and clears the tracked stub set.

    - #### public void generateClass(ClassNode classNode)

      Generates a Java stub for the supplied class when it is eligible for stub generation.

      throws:
        FileNotFoundException if a file-based stub cannot be created
      Parameters:
        `classNode` - the class to generate a stub for

    - #### public Set<JavaFileObject> getJavaStubCompilationUnitSet()

      Returns the generated in-memory or file-backed Java file objects.

      Returns:
        the current set of generated Java stub compilation units