Top Description Fields Constructors Methods
org.codehaus.groovy.transform.stc

public Class EnumTypeCheckingExtension

extends TypeCheckingExtension
Class Inheritance
Imports
org.codehaus.groovy.ast.ClassNode, .FieldNode, org.codehaus.groovy.ast.expr.VariableExpression, org.codehaus.groovy.ast.stmt.SwitchStatement, java.lang.reflect.Modifier

A type checking extension that will take care of handling errors which are specific to enums. In particular, it will handle the enum constants within switch-case statement.
Since
3.0.0

Field Summary

Inherited from org.codehaus.groovy.transform.stc.TypeCheckingExtension:
typeCheckingVisitor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
handleUnresolvedVariableExpression(VariableExpression
the unresolved variable extension
vexp
)

Overrides org.codehaus.groovy.transform.stc.TypeCheckingExtension.handleUnresolvedVariableExpression.

This method is called by the type checker when a variable expression cannot be resolved.
Inherited from org.codehaus.groovy.transform.stc.TypeCheckingExtension:
addStaticTypeErrorafterMethodCallafterVisitClassafterVisitMethodbeforeMethodCallbeforeVisitClassbeforeVisitMethodbuildListTypebuildMapTypeclassNodeForclassNodeForexistsPropertyexistsPropertyextractStaticReceiverfinishgetArgumentTypesgetTargetMethodgetTypehandleAmbiguousMethodshandleIncompatibleAssignmenthandleIncompatibleReturnTypehandleMissingMethodhandleUnresolvedAttributehandleUnresolvedPropertyisStaticMethodCallOnClasslookupClassNodeForonMethodSelectionparameterizedTypesetupstoreType

Constructor Detail

EnumTypeCheckingExtensionback to summary
public EnumTypeCheckingExtension(StaticTypeCheckingVisitor staticTypeCheckingVisitor)

Method Detail

handleUnresolvedVariableExpressionback to summary
public boolean handleUnresolvedVariableExpression(VariableExpression vexp)

Overrides org.codehaus.groovy.transform.stc.TypeCheckingExtension.handleUnresolvedVariableExpression.

Doc from org.codehaus.groovy.transform.stc.TypeCheckingExtension.handleUnresolvedVariableExpression.

This method is called by the type checker when a variable expression cannot be resolved. It gives the extension a chance to resolve it for the type checker.

Parameters
vexp:VariableExpression

the unresolved variable extension

Returns:boolean

boolean false if the extension doesn't handle it, true if the extension handles this variable.

Annotations
@Override