Class AbstractTypeCheckingExtension
java.lang.Object
org.codehaus.groovy.transform.stc.TypeCheckingExtension
org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension
- Direct Known Subclasses:
- GroovyTypeCheckingExtensionSupport,- TraitTypeCheckingExtension
Custom type checking extensions may extend this method in order to benefit from a lot of support methods.
The methods found in this class are made directly available in type checking scripts
 through the GroovyTypeCheckingExtensionSupport class.
- Since:
- 2.3.0
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final TypeCheckingContextprotected booleanprotected booleanFields inherited from class org.codehaus.groovy.transform.stc.TypeCheckingExtensiontypeCheckingVisitor
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractTypeCheckingExtension(StaticTypeCheckingVisitor typeCheckingVisitor) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanargTypeMatches(ClassNode[] argTypes, int index, Class clazz) booleanargTypeMatches(MethodCall call, int index, Class clazz) booleanargTypesMatches(ClassNode[] argTypes, Class... classes) booleanargTypesMatches(MethodCall call, Class... classes) voiddelegatesTo(ClassNode type) voiddelegatesTo(ClassNode type, int strategy) voiddelegatesTo(ClassNode type, int strategy, org.codehaus.groovy.transform.stc.DelegationMetadata parent) booleanfirstArgTypesMatches(ClassNode[] argTypes, Class... classes) booleanfirstArgTypesMatches(MethodCall call, Class... classes) getArguments(MethodCall call) booleanisAnnotatedBy(ASTNode node, Class annotation) booleanisAnnotatedBy(ASTNode node, ClassNode annotation) booleanbooleanisExtensionMethod(MethodNode node) booleanisGenerated(MethodNode node) booleanvoidmakeDynamic(MethodCall call) Used to instruct the type checker that the call is a dynamic method call.makeDynamic(MethodCall call, ClassNode returnType) Used to instruct the type checker that the call is a dynamic method call.voidInstructs the type checker that a property access is dynamic, returning an instance of an Object.voidmakeDynamic(PropertyExpression pexp, ClassNode returnType) Instructs the type checker that a property access is dynamic.voidInstructs the type checker that an unresolved variable is a dynamic variable of type Object.voidmakeDynamic(VariableExpression vexp, ClassNode returnType) Instructs the type checker that an unresolved variable is a dynamic variable.newScope()voidvoidpushEnclosingBinaryExpression(BinaryExpression binaryExpression) voidpushEnclosingClassNode(ClassNode classNode) voidpushEnclosingClosureExpression(ClosureExpression closureExpression) voidpushEnclosingMethod(MethodNode methodNode) voidvoidprotected ObjectvoidsetHandled(boolean handled) unique(MethodNode node) <R> RwithTypeChecker(Closure<R> code) Methods 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, handleMissingMethod, handleUnresolvedAttribute, handleUnresolvedProperty, handleUnresolvedVariableExpression, isStaticMethodCallOnClass, lookupClassNodeFor, onMethodSelection, parameterizedType, setup, storeType
- 
Field Details- 
context
- 
debugprotected boolean debug
- 
handledprotected boolean handled
 
- 
- 
Constructor Details- 
AbstractTypeCheckingExtension
 
- 
- 
Method Details- 
setHandledpublic void setHandled(boolean handled) 
- 
newScope
- 
newScope
- 
scopeExit
- 
getCurrentScope
- 
scopeExit
- 
isGenerated
- 
unique
- 
newMethod
- 
newMethod
- 
newMethod
- 
delegatesTo
- 
delegatesTo
- 
delegatesTopublic void delegatesTo(ClassNode type, int strategy, org.codehaus.groovy.transform.stc.DelegationMetadata parent) 
- 
isAnnotatedBy
- 
isAnnotatedBy
- 
isDynamic
- 
isExtensionMethod
- 
getArguments
- 
safeCall
- 
isMethodCall
- 
argTypesMatches
- 
argTypesMatches
- 
firstArgTypesMatches
- 
firstArgTypesMatches
- 
argTypeMatches
- 
argTypeMatches
- 
withTypeCheckerpublic <R> R withTypeChecker(@DelegatesTo(value=StaticTypeCheckingVisitor.class,strategy=1) @ClosureParams(value=SimpleType.class,options="org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor") Closure<R> code) 
- 
makeDynamicUsed to instruct the type checker that the call is a dynamic method call. Calling this method automatically sets the handled flag to true. The expected return type of the dynamic method call is Object.- Parameters:
- call- the method call which is a dynamic method call
- Returns:
- a virtual method node with the same name as the expected call
 
- 
makeDynamicUsed to instruct the type checker that the call is a dynamic method call. Calling this method automatically sets the handled flag to true.- Parameters:
- call- the method call which is a dynamic method call
- returnType- the expected return type of the dynamic call
- Returns:
- a virtual method node with the same name as the expected call
 
- 
makeDynamicInstructs the type checker that a property access is dynamic, returning an instance of an Object. Calling this method automatically sets the handled flag to true.- Parameters:
- pexp- the property or attribute expression
 
- 
makeDynamicInstructs the type checker that a property access is dynamic. Calling this method automatically sets the handled flag to true.- Parameters:
- pexp- the property or attribute expression
- returnType- the type of the property
 
- 
makeDynamicInstructs the type checker that an unresolved variable is a dynamic variable of type Object. Calling this method automatically sets the handled flag to true.- Parameters:
- vexp- the dynamic variable
 
- 
makeDynamicInstructs the type checker that an unresolved variable is a dynamic variable.- Parameters:
- returnType- the type of the dynamic variable Calling this method automatically sets the handled flag to true.
- vexp- the dynamic variable
 
- 
log
- 
getEnclosingBinaryExpression
- 
pushEnclosingBinaryExpression
- 
pushEnclosingClosureExpression
- 
getEnclosingMethodCall
- 
popEnclosingMethodCall
- 
popEnclosingMethod
- 
getEnclosingClassNode
- 
getEnclosingMethods
- 
getEnclosingMethod
- 
popTemporaryTypeInfopublic void popTemporaryTypeInfo()
- 
pushEnclosingClassNode
- 
popEnclosingBinaryExpression
- 
getEnclosingClassNodes
- 
getEnclosingClosureStack
- 
popEnclosingClassNode
- 
pushEnclosingMethod
- 
getGeneratedMethods
- 
getEnclosingBinaryExpressionStack
- 
getEnclosingClosure
- 
getEnclosingMethodCalls
- 
pushEnclosingMethodCall
- 
popEnclosingClosure
- 
pushTemporaryTypeInfopublic void pushTemporaryTypeInfo()
 
-