Package org.codehaus.groovy.tools.groovydoc.antlr4

# Class GroovyDocParser

java.lang.Object
org.codehaus.groovy.tools.groovydoc.antlr4.GroovyDocParser

All Implemented Interfaces:
  `GroovyDocParserI`

public class GroovyDocParser extends Object implements GroovyDocParserI
Parses Groovy and Java source files and builds `GroovyClassDoc` maps. Groovy sources are processed via the Groovy compiler AST (`GroovydocVisitor`); Java sources via JavaParser (`GroovydocJavaVisitor`).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GroovyDocParser(com.github.javaparser.JavaParser javaParser, List<LinkArgument> links, Properties properties)`
  Creates a parser with the supplied `JavaParser` instance.
  `GroovyDocParser(List<LinkArgument> links, Properties properties)`
  Creates a parser with a default `JavaParser` instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,GroovyClassDoc>`
  `getClassDocsFromSingleSource(String packagePath, String file, String src)`
  Parses one source unit and returns the classes discovered in it.

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

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

- ## Constructor Details

  - ### GroovyDocParser

    public GroovyDocParser(List<LinkArgument> links, Properties properties)
    Creates a parser with a default `JavaParser` instance.

  - ### GroovyDocParser

    public GroovyDocParser(com.github.javaparser.JavaParser javaParser, List<LinkArgument> links, Properties properties)
    Creates a parser with the supplied `JavaParser` instance.
    Since:
      6.0.0

- ## Method Details

  - ### getClassDocsFromSingleSource

    public Map<String,GroovyClassDoc> getClassDocsFromSingleSource(String packagePath, String file, String src) throws RuntimeException
    Parses one source unit and returns the classes discovered in it.
    Specified by:
      `getClassDocsFromSingleSource` in interface `GroovyDocParserI`
    Parameters:
      `packagePath` - the package path associated with the source
      `file` - the source file name
      `src` - the source text to parse
    Returns:
      a map of discovered class names to class documentation objects
    Throws:
      `RuntimeException`