Package org.apache.groovy.antlr

# Class GroovydocVisitor

java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.apache.groovy.antlr.GroovydocVisitor

All Implemented Interfaces:
  `GroovyClassVisitor`, `GroovyCodeVisitor`, `ErrorCollecting`

public class GroovydocVisitor extends ClassCodeVisitorSupport
A visitor which collects Groovydoc information.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GroovydocVisitor(SourceUnit unit, String packagePath, List<LinkArgument> links)`
  Creates a visitor that collects Groovydoc for classes in the given package.
  `GroovydocVisitor(SourceUnit unit, String packagePath, List<LinkArgument> links, Properties properties)`
  Creates a visitor that collects Groovydoc for classes in the given package, using the supplied generation `properties`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,GroovyClassDoc>`
  `getGroovyClassDocs()`
  Returns the collected class documentation, keyed by full path name.
  `protected SourceUnit`
  `getSourceUnit()`
  Provides access to the `SourceUnit` for error reporting during visitation.
  `void`
  `visitClass(ClassNode node)`
  Visits a `ClassNode`, processing its annotations, package, imports, contents, and object initializers.
  `void`
  `visitConstructor(ConstructorNode node)`
  Visits a `ConstructorNode`, processing its annotations, parameter annotations, and code block.
  `void`
  `visitDeclarationExpression(DeclarationExpression expression)`
  Visits a `DeclarationExpression` with annotation processing, traversing expression annotations before delegating to parent traversal.
  `void`
  `visitField(FieldNode node)`
  Visits a `FieldNode`, processing its annotations and initial value expression if present.
  `void`
  `visitMethod(MethodNode node)`
  Visits a `MethodNode`, processing its annotations, parameter annotations, and code block.
  `void`
  `visitProperty(PropertyNode node)`
  Visits a `PropertyNode`, processing its annotations, initial value expression, and getter/setter blocks if present.

  ### Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport

  `addError, visitAnnotation, visitAnnotations, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, visitClosureExpression, visitConstructorOrMethod, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitForLoop, visitIfElse, visitImports, visitObjectInitializerStatements, visitPackage, visitReturnStatement, visitStatement, visitStatementAnnotations, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop`

  ### Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport

  `afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression`

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

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

  ### Methods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor

  `visit, visit, visitEmptyExpression, visitListOfExpressions`

- ## Constructor Details

  - ### GroovydocVisitor

    public GroovydocVisitor(SourceUnit unit, String packagePath, List<LinkArgument> links)
    Creates a visitor that collects Groovydoc for classes in the given package.

  - ### GroovydocVisitor

    public GroovydocVisitor(SourceUnit unit, String packagePath, List<LinkArgument> links, Properties properties)
    Creates a visitor that collects Groovydoc for classes in the given package, using the supplied generation `properties`.

- ## Method Details

  - ### getSourceUnit

    protected SourceUnit getSourceUnit()
    Provides access to the `SourceUnit` for error reporting during visitation. Implementations must override this method.
    Specified by:
      `getSourceUnit` in class `ClassCodeVisitorSupport`
    Returns:
      the source unit for this visitor

  - ### visitClass

    public void visitClass(ClassNode node)
    Visits a `ClassNode`, processing its annotations, package, imports, contents, and object initializers.
    Specified by:
      `visitClass` in interface `GroovyClassVisitor`
    Overrides:
      `visitClass` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the class node to visit

  - ### visitConstructor

    public void visitConstructor(ConstructorNode node)
    Visits a `ConstructorNode`, processing its annotations, parameter annotations, and code block.
    Specified by:
      `visitConstructor` in interface `GroovyClassVisitor`
    Overrides:
      `visitConstructor` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the constructor node to visit

  - ### visitMethod

    public void visitMethod(MethodNode node)
    Visits a `MethodNode`, processing its annotations, parameter annotations, and code block.
    Specified by:
      `visitMethod` in interface `GroovyClassVisitor`
    Overrides:
      `visitMethod` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the method node to visit

  - ### visitProperty

    public void visitProperty(PropertyNode node)
    Visits a `PropertyNode`, processing its annotations, initial value expression, and getter/setter blocks if present.
    Specified by:
      `visitProperty` in interface `GroovyClassVisitor`
    Overrides:
      `visitProperty` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the property node to visit

  - ### visitDeclarationExpression

    public void visitDeclarationExpression(DeclarationExpression expression)
    Visits a `DeclarationExpression` with annotation processing, traversing expression annotations before delegating to parent traversal.
    Specified by:
      `visitDeclarationExpression` in interface `GroovyCodeVisitor`
    Overrides:
      `visitDeclarationExpression` in class `ClassCodeVisitorSupport`
    Parameters:
      `expression` - the declaration expression to visit

  - ### visitField

    public void visitField(FieldNode node)
    Visits a `FieldNode`, processing its annotations and initial value expression if present.
    Specified by:
      `visitField` in interface `GroovyClassVisitor`
    Overrides:
      `visitField` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the field node to visit

  - ### getGroovyClassDocs

    public Map<String,GroovyClassDoc> getGroovyClassDocs()
    Returns the collected class documentation, keyed by full path name.