Top Description Constructors Methods
org.codehaus.groovy.classgen.asm.sc

public Class StaticTypesTypeChooser

extends StatementMetaTypeChooser
Class Inheritance
Imports
org.codehaus.groovy.ast.ASTNode, .ClassHelper, .ClassNode, org.codehaus.groovy.ast.expr.Expression, .VariableExpression, org.codehaus.groovy.classgen.asm.StatementMetaTypeChooser, org.codehaus.groovy.transform.stc.StaticTypesMarker

A TypeChooser which reads type information from node metadata generated by the static type checker.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static ASTNode

Returns:

the target node
getTarget
(final Expression
the expression for which to return the target expression
exp
)

The inferred type, in case of a variable expression, can be set on the accessed variable, so we take it instead of the reference.

public ClassNode
resolveType(final Expression
the expression for which the type must be returned.
exp
,
final ClassNode
the classnode this expression belongs to
current
)

Overrides org.codehaus.groovy.classgen.asm.StatementMetaTypeChooser.resolveType.

Implements org.codehaus.groovy.classgen.asm.TypeChooser.resolveType.

Resolve the type of an expression.

Constructor Detail

StaticTypesTypeChooserback to summary
public StaticTypesTypeChooser()

Method Detail

getTargetback to summary
private static ASTNode getTarget(final Expression exp)

The inferred type, in case of a variable expression, can be set on the accessed variable, so we take it instead of the reference.

Parameters
exp:Expression

the expression for which to return the target expression

Returns:ASTNode

the target node

resolveTypeback to summary
public ClassNode resolveType(final Expression exp, final ClassNode current)

Overrides org.codehaus.groovy.classgen.asm.StatementMetaTypeChooser.resolveType.

Implements org.codehaus.groovy.classgen.asm.TypeChooser.resolveType.

Doc from org.codehaus.groovy.classgen.asm.TypeChooser.resolveType.

Resolve the type of an expression. Depending on the implementations, the returned type may be the declared type or an inferred type.

Parameters
exp:Expression

the expression for which the type must be returned.

current:ClassNode

the classnode this expression belongs to

Returns:ClassNode

the resolved type.

Annotations
@Override