Package org.codehaus.groovy.tools.javac

# Class JavaStubGenerator

java.lang.Object
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
  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.

- ## Method Summary

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

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

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

- ## Constructor Details

  - ### JavaStubGenerator

    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

  - ### JavaStubGenerator

    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 Details

  - ### generateClass

    public void generateClass(ClassNode classNode) throws FileNotFoundException
    Generates a Java stub for the supplied class when it is eligible for stub generation.
    Parameters:
      `classNode` - the class to generate a stub for
    Throws:
      `FileNotFoundException` - if a file-based stub cannot be created

  - ### getJavaStubCompilationUnitSet

    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

  - ### clean

    public void clean()
    Deletes generated stub files and clears the tracked stub set.