Package org.codehaus.groovy.tools.javac

# Class JavaAwareResolveVisitor

java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeExpressionTransformer
org.codehaus.groovy.control.ResolveVisitor
org.codehaus.groovy.tools.javac.JavaAwareResolveVisitor

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

public class JavaAwareResolveVisitor extends ResolveVisitor
Resolve visitor variant used during joint compilation to revisit special constructor calls and track missing imports for Java sources.

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.control.ResolveVisitor

  `CAST_RESOLVE_HINT, DEFAULT_IMPORTS, EMPTY_STRING_ARRAY, QUESTION_MARK`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JavaAwareResolveVisitor(CompilationUnit cu)`
  Creates a resolve visitor for the supplied compilation unit.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addError(String error, ASTNode node)`
  Marks the source unit when a type resolution error indicates imports may need to be reconsidered.
  `protected void`
  `visitClassCodeContainer(Statement stmt)`
  Suppresses class-code-container traversal so normal resolution logic can handle the statements.
  `void`
  `visitConstructor(ConstructorNode node)`
  Resolves a constructor and then revisits any leading special constructor call expression.

  ### Methods inherited from class org.codehaus.groovy.control.ResolveVisitor

  `getSourceUnit, resolve, resolve, resolveFromCompileUnit, resolveFromDefaultImports, resolveFromDefaultImports, resolveFromModule, resolveFromStaticInnerClasses, resolveNestedClass, resolveToInner, resolveToOuter, setClassNodeResolver, startResolving, transform, transformAnnotationConstantExpression, transformBinaryExpression, transformClosureExpression, transformConstructorCallExpression, transformDeclarationExpression, transformMethodCallExpression, transformPropertyExpression, transformVariableExpression, visitAnnotation, visitBlockStatement, visitCatchStatement, visitClass, visitConstructorOrMethod, visitField, visitForLoop, visitProperty, visitStatementAnnotations`

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

  `setSourcePosition, visitAssertStatement, visitCaseStatement, visitClosureExpression, visitDoWhileLoop, visitExpressionStatement, visitIfElse, visitReturnStatement, visitSwitch, visitSwitchExpression, visitSynchronizedStatement, visitThrowStatement, visitWhileLoop, visitYieldStatement`

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

  `visitAnnotations, visitAnnotations, visitBreakStatement, visitContinueStatement, visitDeclarationExpression, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitStatement, visitTryCatchFinally`

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

  `afterSwitchCaseStatementsVisited, afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, 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

  - ### JavaAwareResolveVisitor

    public JavaAwareResolveVisitor(CompilationUnit cu)
    Creates a resolve visitor for the supplied compilation unit.
    Parameters:
      `cu` - the compilation unit being resolved

- ## Method Details

  - ### visitConstructor

    public void visitConstructor(ConstructorNode node)
    Resolves a constructor and then revisits any leading special constructor call expression.
    Specified by:
      `visitConstructor` in interface `GroovyClassVisitor`
    Overrides:
      `visitConstructor` in class `ClassCodeVisitorSupport`
    Parameters:
      `node` - the constructor being visited

  - ### visitClassCodeContainer

    protected void visitClassCodeContainer(Statement stmt)
    Suppresses class-code-container traversal so normal resolution logic can handle the statements.
    Overrides:
      `visitClassCodeContainer` in class `ClassCodeVisitorSupport`
    Parameters:
      `stmt` - the statement container being considered

  - ### addError

    public void addError(String error, ASTNode node)
    Marks the source unit when a type resolution error indicates imports may need to be reconsidered.
    Specified by:
      `addError` in interface `ErrorCollecting`
    Overrides:
      `addError` in class `ClassCodeVisitorSupport`
    Parameters:
      `error` - the error message
      `node` - the node that triggered the error
    See Also:
      - `ErrorCollecting`