Package org.codehaus.groovy.transform.stc

# Class EnumTypeCheckingExtension

java.lang.Object
org.codehaus.groovy.transform.stc.TypeCheckingExtension
org.codehaus.groovy.transform.stc.EnumTypeCheckingExtension

public class EnumTypeCheckingExtension extends TypeCheckingExtension
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 a switch's case statements.

Since:
  3.0.0

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.transform.stc.TypeCheckingExtension

  `typeCheckingVisitor`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EnumTypeCheckingExtension(StaticTypeCheckingVisitor staticTypeCheckingVisitor)`
  Creates the enum-specific type-checking extension.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `handleUnresolvedVariableExpression(VariableExpression vexp)`
  Resolves enum constants referenced inside switch case labels.

  ### Methods inherited from class org.codehaus.groovy.transform.stc.TypeCheckingExtension

  `addStaticTypeError, afterMethodCall, afterVisitClass, afterVisitMethod, beforeMethodCall, beforeVisitClass, beforeVisitMethod, buildListType, buildMapType, classNodeFor, classNodeFor, existsProperty, existsProperty, extractStaticReceiver, finish, getArgumentTypes, getOptions, getTargetMethod, getType, handleAmbiguousMethods, handleIncompatibleAssignment, handleIncompatibleReturnType, handleMissingMethod, handleUnresolvedAttribute, handleUnresolvedProperty, isStaticMethodCallOnClass, lookupClassNodeFor, onMethodSelection, parameterizedType, setOptions, setup, storeType`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EnumTypeCheckingExtension

    public EnumTypeCheckingExtension(StaticTypeCheckingVisitor staticTypeCheckingVisitor)
    Creates the enum-specific type-checking extension.

- ## Method Details

  - ### handleUnresolvedVariableExpression

    public boolean handleUnresolvedVariableExpression(VariableExpression vexp)
    Resolves enum constants referenced inside switch case labels.
    Overrides:
      `handleUnresolvedVariableExpression` in class `TypeCheckingExtension`
    Parameters:
      `vexp` - the unresolved variable extension
    Returns:
      `boolean` false if the extension doesn't handle it, true if the extension handles this variable.