Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.0
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.control
Class ResolveVisitor

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

    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).

author:
  Jochen Theodorou

Nested Class Summary
`class` | `ResolveVisitor.ConstructedClassWithPackage` we use ConstructedClassWithPackage to limit the resolving the compiler does when combining package names and class names.
`class` | `ResolveVisitor.LowerCaseClass` we use LowerCaseClass to limit the resolving the compiler does for vanilla names starting with a lower case letter.

Field Summary
`static String[]` | `DEFAULT_IMPORTS`

Constructor Summary
`ResolveVisitor()`

Method Summary
`def` | `ResolveVisitor(CompilationUnit cu)`
`protected SourceUnit` | `getSourceUnit()`
`void` | `startResolving(ClassNode node, SourceUnit source)`
`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)`
`void` | `visitAnnotations(AnnotatedNode node)`
`void` | `visitBlockStatement(BlockStatement block)`
`void` | `visitCatchStatement(CatchStatement cs)`
`void` | `visitClass(ClassNode node)`
`protected void` | `visitConstructorOrMethod(MethodNode node, boolean isConstructor)`
`void` | `visitField(FieldNode node)`
`void` | `visitForLoop(ForStatement forLoop)`
`void` | `visitProperty(PropertyNode node)`

Methods inherited from class ClassCodeExpressionTransformer
transform, visitAnnotations, visitAssertStatement, visitCaseStatement, visitConstructorOrMethod, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitProperty, visitReturnStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitWhileLoop

Methods inherited from class ClassCodeVisitorSupport
addError, getSourceUnit, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitVariableExpression, visitWhileLoop

Methods inherited from class CodeVisitorSupport
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, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitRegexExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Field Detail

### DEFAULT_IMPORTS

    static final String[] DEFAULT_IMPORTS

Constructor Detail

### ResolveVisitor

    ResolveVisitor()

Method Detail

### ResolveVisitor

    public def ResolveVisitor(CompilationUnit cu)

### getSourceUnit

    protected SourceUnit getSourceUnit()

### startResolving

    public void startResolving(ClassNode node, SourceUnit source)

### transform

    public Expression transform(Expression exp)

### transformAnnotationConstantExpression

    protected Expression transformAnnotationConstantExpression(AnnotationConstantExpression ace)

### transformBinaryExpression

    protected Expression transformBinaryExpression(BinaryExpression be)

### transformClosureExpression

    protected Expression transformClosureExpression(ClosureExpression ce)

### transformConstructorCallExpression

    protected Expression transformConstructorCallExpression(ConstructorCallExpression cce)

### transformDeclarationExpression

    protected Expression transformDeclarationExpression(DeclarationExpression de)

### transformMethodCallExpression

    protected Expression transformMethodCallExpression(MethodCallExpression mce)

### transformPropertyExpression

    protected Expression transformPropertyExpression(PropertyExpression pe)

### transformVariableExpression

    protected Expression transformVariableExpression(VariableExpression ve)

### visitAnnotations

    public void visitAnnotations(AnnotatedNode node)

### visitBlockStatement

    public void visitBlockStatement(BlockStatement block)

### visitCatchStatement

    public void visitCatchStatement(CatchStatement cs)

### visitClass

    public void visitClass(ClassNode node)

### visitConstructorOrMethod

    protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)

### visitField

    public void visitField(FieldNode node)

### visitForLoop

    public void visitForLoop(ForStatement forLoop)

### visitProperty

    public void visitProperty(PropertyNode node)

Copyright © 2003-2009 The Codehaus. All rights reserved.