Class TraitTypeCheckingExtension
java.lang.Object
org.codehaus.groovy.transform.stc.TypeCheckingExtension
org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension
org.codehaus.groovy.transform.stc.TraitTypeCheckingExtension
An extension that handles field, super and static method calls within a trait.
- Since:
- 2.3.0
- 
Nested Class SummaryNested classes/interfaces inherited from class org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtensionAbstractTypeCheckingExtension.TypeCheckingScope
- 
Field SummaryFields inherited from class org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtensioncontext, debug, handledFields inherited from class org.codehaus.groovy.transform.stc.TypeCheckingExtensiontypeCheckingVisitor
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionhandleMissingMethod(ClassNode receiver, String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call) This method is called by the type checker when a method call cannot be resolved.booleanThis method is called by the type checker when a property expression cannot be resolved (for example, when a property doesn't exist).Methods inherited from class org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtensionargTypeMatches, argTypeMatches, argTypesMatches, argTypesMatches, delegatesTo, delegatesTo, delegatesTo, firstArgTypesMatches, firstArgTypesMatches, getArguments, getCurrentScope, getEnclosingBinaryExpression, getEnclosingBinaryExpressionStack, getEnclosingClassNode, getEnclosingClassNodes, getEnclosingClosure, getEnclosingClosureStack, getEnclosingMethod, getEnclosingMethodCall, getEnclosingMethodCalls, getEnclosingMethods, getGeneratedMethods, isAnnotatedBy, isAnnotatedBy, isDynamic, isExtensionMethod, isGenerated, isMethodCall, log, makeDynamic, makeDynamic, makeDynamic, makeDynamic, makeDynamic, makeDynamic, newMethod, newMethod, newMethod, newScope, newScope, popEnclosingBinaryExpression, popEnclosingClassNode, popEnclosingClosure, popEnclosingMethod, popEnclosingMethodCall, popTemporaryTypeInfo, pushEnclosingBinaryExpression, pushEnclosingClassNode, pushEnclosingClosureExpression, pushEnclosingMethod, pushEnclosingMethodCall, pushTemporaryTypeInfo, safeCall, scopeExit, scopeExit, setHandled, unique, withTypeCheckerMethods inherited from class org.codehaus.groovy.transform.stc.TypeCheckingExtensionaddStaticTypeError, afterMethodCall, afterVisitClass, afterVisitMethod, beforeMethodCall, beforeVisitClass, beforeVisitMethod, buildListType, buildMapType, classNodeFor, classNodeFor, existsProperty, existsProperty, extractStaticReceiver, finish, getArgumentTypes, getTargetMethod, getType, handleAmbiguousMethods, handleIncompatibleAssignment, handleIncompatibleReturnType, handleUnresolvedAttribute, handleUnresolvedVariableExpression, isStaticMethodCallOnClass, lookupClassNodeFor, onMethodSelection, parameterizedType, setup, storeType
- 
Constructor Details- 
TraitTypeCheckingExtension
 
- 
- 
Method Details- 
handleMissingMethodpublic List<MethodNode> handleMissingMethod(ClassNode receiver, String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call) Description copied from class:TypeCheckingExtensionThis method is called by the type checker when a method call cannot be resolved. Extensions may override this method to handle missing methods and prevent the type checker from throwing an error.- Overrides:
- handleMissingMethodin class- TypeCheckingExtension
- Parameters:
- receiver- the type of the receiver
- name- the name of the called method
- argumentList- the list of arguments of the call
- argumentTypes- the types of the arguments of the call
- call- the method call itself, if needed
- Returns:
- an empty list if the extension cannot resolve the method, or a list of potential methods if the extension finds candidates. This method must not return null.
 
- 
handleUnresolvedPropertyDescription copied from class:TypeCheckingExtensionThis method is called by the type checker when a property expression cannot be resolved (for example, when a property doesn't exist). It gives the extension a chance to resolve it.- Overrides:
- handleUnresolvedPropertyin class- TypeCheckingExtension
- Parameters:
- pexp- the unresolved property
- Returns:
- booleanfalse if this extension doesn't resolve the property, true if it resolves the property.
 
 
-