Class SimpleGroovyRootDoc

java.lang.Object
org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc
org.codehaus.groovy.tools.groovydoc.SimpleGroovyRootDoc
All Implemented Interfaces:
Comparable<GroovyDoc>, GroovyDoc, GroovyDocErrorReporter, GroovyRootDoc

public class SimpleGroovyRootDoc extends SimpleGroovyDoc implements GroovyRootDoc
Default GroovyRootDoc implementation used to collect packages, classes, and lookup caches.
  • Constructor Details

    • SimpleGroovyRootDoc

      public SimpleGroovyRootDoc(String name)
      Creates a root documentation model with the supplied name.
      Parameters:
      name - the root document name
  • Method Details

    • getSourcepaths

      public String[] getSourcepaths()
      Returns the source paths used to build this root document.
      Returns:
      the configured source paths
      Since:
      6.0.0
    • setSourcepaths

      public void setSourcepaths(String[] sourcepaths)
      Stores the source paths used to build this root document.
      Parameters:
      sourcepaths - the source paths to retain
      Since:
      6.0.0
    • classNamed

      public GroovyClassDoc classNamed(GroovyClassDoc groovyClassDoc, String name)
      Resolves a class name from the perspective of another documented class.
      Specified by:
      classNamed in interface GroovyRootDoc
      Parameters:
      groovyClassDoc - the class providing the lookup context
      name - the class name to resolve
      Returns:
      the matching class documentation, or null if it cannot be resolved
    • classNamedExact

      public GroovyClassDoc classNamedExact(String name)
      Resolves a class using its exact internal name.
      Parameters:
      name - the exact class name to resolve
      Returns:
      the matching class documentation, or null if none exists
    • setDescription

      public void setDescription(String description)
      Sets the root description text.
      Parameters:
      description - the root description
    • description

      public String description()
      Returns the root description text.
      Returns:
      the configured description
    • summary

      public String summary()
      Returns the first-sentence summary derived from description().
      Returns:
      the first-sentence summary
    • classes

      public GroovyClassDoc[] classes()
      Returns all classes known to this documentation run.
      Specified by:
      classes in interface GroovyRootDoc
      Returns:
      the discovered classes
    • options

      public String[][] options()
      Returns the effective tool options associated with this documentation run.
      Specified by:
      options in interface GroovyRootDoc
      Returns:
      the configured options
    • packageNamed

      public GroovyPackageDoc packageNamed(String packageName)
      Resolves a package by name.
      Specified by:
      packageNamed in interface GroovyRootDoc
      Parameters:
      packageName - the package name to resolve
      Returns:
      the matching package documentation, or null if none exists
    • putAllClasses

      public void putAllClasses(Map<String,GroovyClassDoc> classes)
      Adds all supplied classes to this root document.
      Parameters:
      classes - the classes to add
    • put

      public void put(String packageName, GroovyPackageDoc packageDoc)
      Adds a package to this root document.
      Parameters:
      packageName - the package name key
      packageDoc - the package documentation object
    • specifiedClasses

      public GroovyClassDoc[] specifiedClasses()
      Returns the classes explicitly specified as documentation targets.
      Specified by:
      specifiedClasses in interface GroovyRootDoc
      Returns:
      the specified classes
    • specifiedPackages

      public GroovyPackageDoc[] specifiedPackages()
      Returns the packages explicitly specified as documentation targets.
      Specified by:
      specifiedPackages in interface GroovyRootDoc
      Returns:
      the specified packages
    • getVisibleClasses

      public Map<String,GroovyClassDoc> getVisibleClasses(List importedClassesAndPackages)
      Returns the classes visible from a set of imports.
      Specified by:
      getVisibleClasses in interface GroovyRootDoc
      Parameters:
      importedClassesAndPackages - the imported classes and packages to evaluate
      Returns:
      a map of visible class names to class documentation
    • getResolvedClasses

      public Map<String,GroovyClassDoc> getResolvedClasses()
      Returns the classes that have already been resolved for the current documentation run.
      Specified by:
      getResolvedClasses in interface GroovyRootDoc
      Returns:
      a map of resolved class names to class documentation
    • printError

      public void printError(String arg0)
      Reports an error message.
      Specified by:
      printError in interface GroovyDocErrorReporter
      Parameters:
      arg0 - the error message
    • printNotice

      public void printNotice(String arg0)
      Reports an informational notice.
      Specified by:
      printNotice in interface GroovyDocErrorReporter
      Parameters:
      arg0 - the notice message
    • printWarning

      public void printWarning(String arg0)
      Reports a warning message.
      Specified by:
      printWarning in interface GroovyDocErrorReporter
      Parameters:
      arg0 - the warning message
    • resolve

      public void resolve()
      Resolves deferred type references across all collected classes.