Package org.codehaus.groovy.tools.groovydoc

# Class GroovyDocTool

java.lang.Object
org.codehaus.groovy.tools.groovydoc.GroovyDocTool

public class GroovyDocTool extends Object
Coordinates source parsing and template-driven rendering for GroovyDoc generation.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Properties`
  `properties`
  Rendering properties shared with the parser and template engine.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GroovyDocTool(String[] sourcepaths)`
  Constructor for use by people who only want to interact with the Groovy Doclet Tree (rootDoc)
  `GroovyDocTool(ResourceManager resourceManager, String[] sourcepaths, String classTemplate)`
  Creates a GroovyDocTool with a resource manager, source paths, and a single class-level template.
  `GroovyDocTool(ResourceManager resourceManager, String[] sourcepaths, String[] docTemplates, String[] packageTemplates, String[] classTemplates, List<LinkArgument> links, String javaVersion, Properties properties)`
  Constructs a GroovyDocTool instance with the specified parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(List<String> filenames)`
  Adds source files to the documentation set.
  `int`
  `getErrorCount()`
  `GroovyRootDoc`
  `getRootDoc()`
  Returns the root documentation object built from all added source files.
  `void`
  `renderToOutput(OutputTool output, String destdir)`
  Renders the collected documentation to the given output using the configured templates.

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

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

- ## Field Details

  - ### properties

    protected Properties properties
    Rendering properties shared with the parser and template engine.

- ## Constructor Details

  - ### GroovyDocTool

    public GroovyDocTool(String[] sourcepaths)
    Constructor for use by people who only want to interact with the Groovy Doclet Tree (rootDoc)
    Parameters:
      `sourcepaths` - where the sources to be added can be found

  - ### GroovyDocTool

    public GroovyDocTool(ResourceManager resourceManager, String[] sourcepaths, String classTemplate)
    Creates a GroovyDocTool with a resource manager, source paths, and a single class-level template.

  - ### GroovyDocTool

    public GroovyDocTool(ResourceManager resourceManager, String[] sourcepaths, String[] docTemplates, String[] packageTemplates, String[] classTemplates, List<LinkArgument> links, String javaVersion, Properties properties)
    Constructs a GroovyDocTool instance with the specified parameters.
    Parameters:
      `resourceManager` - the resource manager for handling resources, or null if not required
      `sourcepaths` - the paths to the source files to be processed
      `docTemplates` - the templates for generating documentation
      `packageTemplates` - the templates for generating package-level documentation
      `classTemplates` - the templates for generating class-level documentation
      `links` - a list of link arguments for external references
      `javaVersion` - the Java version to be used for parsing and processing Java source files
      `properties` - additional properties to be used when generating the groovydoc

- ## Method Details

  - ### add

    public void add(List<String> filenames) throws IOException
    Adds source files to the documentation set.
    Parameters:
      `filenames` - relative source file paths to process
    Throws:
      `IOException` - if a file cannot be read

  - ### getRootDoc

    public GroovyRootDoc getRootDoc()
    Returns the root documentation object built from all added source files.

  - ### getErrorCount

    public int getErrorCount()
    Returns:
      the number of source files that could not be parsed
    Since:
      6.0.0

  - ### renderToOutput

    public void renderToOutput(OutputTool output, String destdir) throws Exception
    Renders the collected documentation to the given output using the configured templates.
    Parameters:
      `output` - the output destination
      `destdir` - the destination directory path
    Throws:
      `Exception` - if rendering fails