Package: org.codehaus.groovy.ant

## [Java] Class Groovydoc

- org.codehaus.groovy.ant.Groovydoc

-     public class Groovydoc
      extends Task

  Access to the GroovyDoc tool from Ant.

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `class` | `Groovydoc.AddStylesheet` | Nested-element holder populated by Ant introspection for `<addStylesheet file="..."/>`.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Groovydoc()` Creates a Groovydoc Ant task with the default option set.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Groovydoc.AddStylesheet` | `createAddStylesheet()` GROOVY-11941: Ant nested element `<addStylesheet file="custom.css"/>` to include an additional stylesheet in the generated docs alongside the default.
    `` | `public LinkArgument` | `createLink()` Create link to Javadoc/GroovyDoc output at the given URL.
    `` | `public void` | `execute()` Generates Groovydoc output for the configured source path.
    `` | `protected String[]` | `getClassTemplates()` Creates and returns an array of class template classpath entries.
    `` | `protected String[]` | `getDocTemplates()` Creates and returns an array of doc template classpath entries.
    `` | `protected String[]` | `getPackageTemplates()` Creates and returns an array of package template classpath entries.
    `` | `public void` | `setAccess(String access)` Indicates the access mode or scope of interest: one of public, protected, package, or private.
    `` | `public void` | `setAuthor(boolean author)` If set to false, author will not be displayed.
    `` | `public void` | `setCharset(String charset)` Specifies the charset to be used in the templates, i.e. the value output within: <meta http-equiv="Content-Type" content="text/html; charset=charset">.
    `` | `public void` | `setDestdir(File dir)` Set the directory where the Groovydoc output will be generated.
    `` | `public void` | `setDoctitle(String htmlTitle)` Set the title for the overview page.
    `` | `public void` | `setExcludePackageNames(String packages)` Set the packages to exclude from documentation.
    `` | `public void` | `setExtensions(String extensions)` A colon-separated list of filename extensions to look for when searching for files to process in a given directory.
    `` | `public void` | `setFileEncoding(String fileEncoding)` Specifies the file encoding to be used for generated files.
    `` | `public void` | `setFooter(String footer)` Set the footer to place at the bottom of each generated html page.
    `` | `public void` | `setHeader(String header)` Specifies the header text to be placed at the top of each output file.
    `` | `public void` | `setIncludeMainForScripts(boolean includeMainForScripts)` If set to false, 'public static void main' method will not be displayed.
    `` | `public void` | `setJavaVersion(String javaVersion)` Defaults to a popular Java version defined by the JavaParser library.
    `` | `public void` | `setNoDeprecatedList(boolean noDeprecatedList)` GROOVY-11943: if set to true, suppress generation of the deprecated-list page (`deprecated-list.html`) and its nav-bar link.
    `` | `public void` | `setNoHelp(boolean noHelp)` GROOVY-11943: if set to true, suppress generation of the help page (`help-doc.html`) and its nav-bar link.
    `` | `public void` | `setNoIndex(boolean noIndex)` GROOVY-11943: if set to true, suppress generation of the alphabetical index page (`index-all.html`) and its nav-bar link.
    `` | `public void` | `setNoTimestamp(boolean noTimestamp)` If set to true, hidden timestamp will not appear within generated HTML.
    `` | `public void` | `setNoVersionStamp(boolean noVersionStamp)` If set to true, hidden version stamp will not appear within generated HTML.
    `` | `public void` | `setOverview(File file)` Specify the file containing the overview to be included in the generated documentation.
    `` | `public void` | `setPackage(boolean b)` Indicate whether only package, protected and public classes and members are to be included in the scope processed.
    `` | `public void` | `setPackagenames(String packages)` Set the package names to be processed.
    `` | `public void` | `setPreLanguage(String preLanguage)` Default language id for `<pre>` blocks in rendered doc comments that carry no `class=` attribute.
    `` | `public void` | `setPrivate(boolean b)` Indicate whether all classes and members are to be included in the scope processed.
    `` | `public void` | `setProcessScripts(boolean processScripts)` If set to false, Scripts will not be processed.
    `` | `public void` | `setProtected(boolean b)` Indicate whether only protected and public classes and members are to be included in the scope processed.
    `` | `public void` | `setPublic(boolean b)` Indicate whether only public classes and members are to be included in the scope processed.
    `` | `public void` | `setShowInternal(boolean showInternal)` If set to true, members annotated with {@code groovy.transform.
    `` | `public void` | `setSourcepath(Path src)` Specify where to find source file
    `` | `public void` | `setStyleSheetFile(File styleSheetFile)` Specifies a stylesheet file to use.
    `` | `public void` | `setSyntaxHighlighter(String syntaxHighlighter)` GROOVY-11938 stage 4: selects a client-side syntax highlighter for `{@snippet}` and fenced Markdown code blocks.
    `` | `public void` | `setTheme(String theme)` GROOVY-11947: theme lock mode for the generated docs.
    `` | `public void` | `setUse(boolean b)` Accepts the historical Ant `use` attribute for compatibility.
    `` | `public void` | `setWindowtitle(String title)` Set the title to be placed in the HTML <title> tag of the generated documentation.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Task` | `bindToOwner, clone, equals, execute, getClass, getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getTaskName, getTaskType, hashCode, init, log, log, log, log, maybeConfigure, notify, notifyAll, perform, reconfigure, setDescription, setLocation, setOwningTarget, setProject, setRuntimeConfigurableWrapper, setTaskName, setTaskType, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public Groovydoc()

      Creates a Groovydoc Ant task with the default option set.

  - ### Method Detail

    - #### public Groovydoc.AddStylesheet createAddStylesheet()

      GROOVY-11941: Ant nested element `<addStylesheet file="custom.css"/>` to include an additional stylesheet in the generated docs alongside the default. Repeatable — specify once per extra stylesheet.

      Returns:
        a holder that Ant will populate with the nested element's file attribute
      Since:
        6.0.0

    - #### public LinkArgument createLink()

      Create link to Javadoc/GroovyDoc output at the given URL.

      Returns:
        link argument to configure

    - #### public void execute()

      Generates Groovydoc output for the configured source path.

      throws:
        BuildException if generation fails

    - #### protected String[] getClassTemplates()

      Creates and returns an array of class template classpath entries.

      This method is meant to be overridden by custom GroovyDoc implementations, using custom class templates.

      Returns:
        an array of class templates, whereas each entry is resolved as classpath entry, defaults to GroovyDocTemplateInfo.DEFAULT_CLASS_TEMPLATES.

    - #### protected String[] getDocTemplates()

      Creates and returns an array of doc template classpath entries.

      This method is meant to be overridden by custom GroovyDoc implementations, using custom doc templates.

      Returns:
        an array of doc templates, whereas each entry is resolved as classpath entry, defaults to GroovyDocTemplateInfo.DEFAULT_DOC_TEMPLATES.

    - #### protected String[] getPackageTemplates()

      Creates and returns an array of package template classpath entries.

      This method is meant to be overridden by custom GroovyDoc implementations, using custom package templates.

      Returns:
        an array of package templates, whereas each entry is resolved as classpath entry, defaults to GroovyDocTemplateInfo.DEFAULT_PACKAGE_TEMPLATES.

    - #### public void setAccess(String access)

      Indicates the access mode or scope of interest: one of public, protected, package, or private. Package scoped access is ignored for fields of Groovy classes where they correspond to properties.

      Parameters:
        `access` - one of public, protected, package, or private

    - #### public void setAuthor(boolean author)

      If set to false, author will not be displayed. Currently not used.

      Parameters:
        `author` - new value

    - #### public void setCharset(String charset)

      Specifies the charset to be used in the templates, i.e. the value output within: <meta http-equiv="Content-Type" content="text/html; charset=charset">.

      Parameters:
        `charset` - the charset value

    - #### public void setDestdir(File dir)

      Set the directory where the Groovydoc output will be generated.

      Parameters:
        `dir` - the destination directory.

    - #### public void setDoctitle(String htmlTitle)

      Set the title for the overview page.

      Parameters:
        `htmlTitle` - the html to use for the title.

    - #### public void setExcludePackageNames(String packages)

      Set the packages to exclude from documentation. Mirrors the CLI `-exclude` option; the Ant task already honoured `excludePackageNames` internally when generating but lacked the public setter.

      Parameters:
        `packages` - a comma-separated (or colon-separated, to match the CLI form) list of package specs, possibly wildcarded.
      Since:
        6.0.0

    - #### public void setExtensions(String extensions)

      A colon-separated list of filename extensions to look for when searching for files to process in a given directory. Default value: `.java:.groovy:.gv:.gvy:.gsh`

      Parameters:
        `extensions` - new value

    - #### public void setFileEncoding(String fileEncoding)

      Specifies the file encoding to be used for generated files. If fileEncoding is missing, the charset encoding will be used for writing the files. If fileEncoding and charset are missing, the file encoding will default to Charset.defaultCharset().

      Parameters:
        `fileEncoding` - the file encoding

    - #### public void setFooter(String footer)

      Set the footer to place at the bottom of each generated html page.

      Parameters:
        `footer` - the footer value

    - #### public void setHeader(String header)

      Specifies the header text to be placed at the top of each output file. The header will be placed to the right of the upper navigation bar. It may contain HTML tags and white space, though if it does, it must be enclosed in quotes. Any internal quotation marks within the header may have to be escaped.

      Parameters:
        `header` - the header value

    - #### public void setIncludeMainForScripts(boolean includeMainForScripts)

      If set to false, 'public static void main' method will not be displayed. Defaults to true. Ignored when not processing Scripts.

      Parameters:
        `includeMainForScripts` - new value

    - #### public void setJavaVersion(String javaVersion)

      Defaults to a popular Java version defined by the JavaParser library. Otherwise, override here for a specific expected source file version.

      Parameters:
        `javaVersion` - the expected source level of any Java files that may be parsed; e.g. JAVA_11

    - #### public void setNoDeprecatedList(boolean noDeprecatedList)

      GROOVY-11943: if set to true, suppress generation of the deprecated-list page (`deprecated-list.html`) and its nav-bar link.

      Since:
        6.0.0

    - #### public void setNoHelp(boolean noHelp)

      GROOVY-11943: if set to true, suppress generation of the help page (`help-doc.html`) and its nav-bar link.

      Since:
        6.0.0

    - #### public void setNoIndex(boolean noIndex)

      GROOVY-11943: if set to true, suppress generation of the alphabetical index page (`index-all.html`) and its nav-bar link.

      Since:
        6.0.0

    - #### public void setNoTimestamp(boolean noTimestamp)

      If set to true, hidden timestamp will not appear within generated HTML.

      Parameters:
        `noTimestamp` - new value

    - #### public void setNoVersionStamp(boolean noVersionStamp)

      If set to true, hidden version stamp will not appear within generated HTML.

      Parameters:
        `noVersionStamp` - new value

    - #### public void setOverview(File file)

      Specify the file containing the overview to be included in the generated documentation.

      Parameters:
        `file` - the overview file

    - #### public void setPackage(boolean b)

      Indicate whether only package, protected and public classes and members are to be included in the scope processed. Package scoped access is ignored for fields of Groovy classes where they correspond to properties.

      Parameters:
        `b` - true if scope includes package level classes and members

    - #### public void setPackagenames(String packages)

      Set the package names to be processed.

      Parameters:
        `packages` - a comma separated list of packages specs (may be wildcarded).

    - #### public void setPreLanguage(String preLanguage)

      Default language id for `<pre>` blocks in rendered doc comments that carry no `class=` attribute. When set (e.g. `"groovy"`), a post-pass rewrites such `<pre>` openings to `<pre class="language-xxx">`, which enables Prism syntax highlighting for legacy doc-comment code blocks without touching source files. `<pre>` blocks that already have any `class` attribute (including `class="groovyTestCase"`) are left alone.

      Parameters:
        `preLanguage` - the language id, or empty/null to disable
      Since:
        6.0.0

    - #### public void setPrivate(boolean b)

      Indicate whether all classes and members are to be included in the scope processed.

      Parameters:
        `b` - true if scope is to be private level.

    - #### public void setProcessScripts(boolean processScripts)

      If set to false, Scripts will not be processed. Defaults to true.

      Parameters:
        `processScripts` - new value

    - #### public void setProtected(boolean b)

      Indicate whether only protected and public classes and members are to be included in the scope processed.

      Parameters:
        `b` - true if scope includes protected level classes and members

    - #### public void setPublic(boolean b)

      Indicate whether only public classes and members are to be included in the scope processed.

      Parameters:
        `b` - true if scope only includes public level classes and members

    - #### public void setShowInternal(boolean showInternal)

      If set to true, members annotated with `groovy.transform.@Internal` (per GEP-17) are still included in the generated documentation. Defaults to false, so internal members are hidden.

      Parameters:
        `showInternal` - new value
      Since:
        6.0.0

    - #### public void setSourcepath(Path src)

      Specify where to find source file

      Parameters:
        `src` - a Path instance containing the various source directories.

    - #### public void setStyleSheetFile(File styleSheetFile)

      Specifies a stylesheet file to use. If not specified, a default one will be generated for you.

      Parameters:
        `styleSheetFile` - the css stylesheet file to use

    - #### public void setSyntaxHighlighter(String syntaxHighlighter)

      GROOVY-11938 stage 4: selects a client-side syntax highlighter for `{@snippet}` and fenced Markdown code blocks. Valid values are `"prism"` (bundled) or `"none"` (default). Any other value is treated as `"none"`.

      Since:
        6.0.0

    - #### public void setTheme(String theme)

      GROOVY-11947: theme lock mode for the generated docs.

      - `"auto"` (default) — emit a `prefers-color-scheme` media query so each reader sees their OS preference.
      - `"light"` — lock the palette to light regardless of OS.
      - `"dark"` — lock the palette to dark regardless of OS.
      Any other value is treated as `"auto"`.
      Since:
        6.0.0

    - #### public void setUse(boolean b)

      Accepts the historical Ant `use` attribute for compatibility.

      Parameters:
        `b` - ignored

    - #### public void setWindowtitle(String title)

      Set the title to be placed in the HTML <title> tag of the generated documentation.

      Parameters:
        `title` - the window title to use.