Package: org.codehaus.groovy.control

## [Java] Class ResolveVisitor

- org.codehaus.groovy.control.ResolveVisitor

-     public class ResolveVisitor
      extends ClassCodeExpressionTransformer

  Visitor to resolve Types and convert VariableExpression to ClassExpressions if needed. The ResolveVisitor will try to find the Class for a ClassExpression and prints an error if it fails to do so. Constructions like C[], foo as C, (C) foo will force creation of a ClassExpression for C

  Note: the method to start the resolving is startResolving(ClassNode, SourceUnit).

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String[]` | `DEFAULT_IMPORTS` |
    `static String[]` | `EMPTY_STRING_ARRAY` |
    `static String` | `QUESTION_MARK` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ResolveVisitor (CompilationUnit compilationUnit)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected SourceUnit` | `getSourceUnit()`
    `` | `protected boolean` | `resolve(ClassNode type)`
    `` | `protected boolean` | `resolve(ClassNode type, boolean testModuleImports, boolean testDefaultImports, boolean testStaticInnerClasses)`
    `` | `protected boolean` | `resolveFromCompileUnit(ClassNode type)`
    `` | `protected boolean` | `resolveFromDefaultImports(ClassNode type)`
    `` | `protected boolean` | `resolveFromDefaultImports(ClassNode type, String[] packagePrefixes)`
    `` | `protected boolean` | `resolveFromModule(ClassNode type, boolean testModuleImports)`
    `` | `protected boolean` | `resolveFromStaticInnerClasses(ClassNode type)`
    `` | `protected boolean` | `resolveNestedClass(ClassNode type)`
    `` | `protected boolean` | `resolveToInner(ClassNode type)`
    `` | `protected boolean` | `resolveToOuter(ClassNode type)`
    `` | `public void` | `setClassNodeResolver(ClassNodeResolver classNodeResolver)`
    `` | `public void` | `startResolving(ClassNode node, SourceUnit source)`
    `` | `public Expression` | `transform(Expression exp)`
    `` | `protected Expression` | `transformAnnotationConstantExpression(AnnotationConstantExpression ace)`
    `` | `protected Expression` | `transformBinaryExpression(BinaryExpression be)`
    `` | `protected Expression` | `transformClosureExpression(ClosureExpression ce)`
    `` | `protected Expression` | `transformConstructorCallExpression(ConstructorCallExpression cce)`
    `` | `protected Expression` | `transformDeclarationExpression(DeclarationExpression de)`
    `` | `protected Expression` | `transformMethodCallExpression(MethodCallExpression mce)`
    `` | `protected Expression` | `transformPropertyExpression(PropertyExpression pe)`
    `` | `protected Expression` | `transformVariableExpression(VariableExpression ve)`
    `` | `public void` | `visitAnnotations(AnnotatedNode node)`
    `` | `public void` | `visitBlockStatement(BlockStatement block)`
    `` | `public void` | `visitCatchStatement(CatchStatement cs)`
    `` | `public void` | `visitClass(ClassNode node)`
    `` | `protected void` | `visitConstructorOrMethod(MethodNode node, boolean isConstructor)`
    `` | `public void` | `visitField(FieldNode node)`
    `` | `public void` | `visitForLoop(ForStatement forLoop)`
    `` | `public void` | `visitProperty(PropertyNode node)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class ClassCodeExpressionTransformer` | `setSourcePosition, transform, visitAnnotation, visitAssertStatement, visitCaseStatement, visitConstructorOrMethod, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitProperty, visitReturnStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitWhileLoop`
    `class ClassCodeVisitorSupport` | `addError, getSourceUnit, visitAnnotation, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop`
    `class CodeVisitorSupport` | `afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAssertStatement, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitBooleanExpression, visitBreakStatement, visitBytecodeExpression, visitCaseStatement, visitCastExpression, visitCatchStatement, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitEmptyStatement, visitExpressionStatement, visitFieldExpression, visitForLoop, visitGStringExpression, visitIfElse, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop`

- - ### Field Detail

    - #### public static final String[] DEFAULT_IMPORTS

    - #### public static final String[] EMPTY_STRING_ARRAY

    - #### public static final String QUESTION_MARK

  - ### Constructor Detail

    - #### public ResolveVisitor(CompilationUnit compilationUnit)

  - ### Method Detail

    - #### @Override protected SourceUnit getSourceUnit()

    - #### protected boolean resolve(ClassNode type)

    - #### protected boolean resolve(ClassNode type, boolean testModuleImports, boolean testDefaultImports, boolean testStaticInnerClasses)

    - #### protected boolean resolveFromCompileUnit(ClassNode type)

    - #### protected boolean resolveFromDefaultImports(ClassNode type)

    - #### protected boolean resolveFromDefaultImports(ClassNode type, String[] packagePrefixes)

    - #### protected boolean resolveFromModule(ClassNode type, boolean testModuleImports)

    - #### protected boolean resolveFromStaticInnerClasses(ClassNode type)

    - #### protected boolean resolveNestedClass(ClassNode type)

    - #### protected boolean resolveToInner(ClassNode type)

    - #### protected boolean resolveToOuter(ClassNode type)

    - #### public void setClassNodeResolver(ClassNodeResolver classNodeResolver)

    - #### public void startResolving(ClassNode node, SourceUnit source)

    - #### @Override public Expression transform(Expression exp)

    - #### protected Expression transformAnnotationConstantExpression(AnnotationConstantExpression ace)

    - #### protected Expression transformBinaryExpression(BinaryExpression be)

    - #### protected Expression transformClosureExpression(ClosureExpression ce)

    - #### protected Expression transformConstructorCallExpression(ConstructorCallExpression cce)

    - #### protected Expression transformDeclarationExpression(DeclarationExpression de)

    - #### protected Expression transformMethodCallExpression(MethodCallExpression mce)

    - #### protected Expression transformPropertyExpression(PropertyExpression pe)

    - #### protected Expression transformVariableExpression(VariableExpression ve)

    - #### @Override public void visitAnnotations(AnnotatedNode node)

    - #### @Override public void visitBlockStatement(BlockStatement block)

    - #### @Override public void visitCatchStatement(CatchStatement cs)

    - #### @Override public void visitClass(ClassNode node)

    - #### @Override protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)

    - #### @Override public void visitField(FieldNode node)

    - #### @Override public void visitForLoop(ForStatement forLoop)

    - #### @Override public void visitProperty(PropertyNode node)