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
-
Field Summary
Modifier and TypeFieldDescriptionprotected final TypeCheckingContext
protected boolean
protected boolean
Fields inherited from class org.codehaus.groovy.transform.stc.TypeCheckingExtension
typeCheckingVisitor
-
Constructor Summary
ConstructorDescriptionAbstractTypeCheckingExtension
(StaticTypeCheckingVisitor typeCheckingVisitor) -
Method Summary
Modifier and TypeMethodDescriptionboolean
argTypeMatches
(ClassNode[] argTypes, int index, Class clazz) boolean
argTypeMatches
(MethodCall call, int index, Class clazz) boolean
argTypesMatches
(ClassNode[] argTypes, Class... classes) boolean
argTypesMatches
(MethodCall call, Class... classes) void
delegatesTo
(ClassNode type) void
delegatesTo
(ClassNode type, int strategy) void
delegatesTo
(ClassNode type, int strategy, org.codehaus.groovy.transform.stc.DelegationMetadata parent) boolean
firstArgTypesMatches
(ClassNode[] argTypes, Class... classes) boolean
firstArgTypesMatches
(MethodCall call, Class... classes) getArguments
(MethodCall call) org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope
boolean
isAnnotatedBy
(ASTNode node, Class annotation) boolean
isAnnotatedBy
(ASTNode node, ClassNode annotation) boolean
boolean
isExtensionMethod
(MethodNode node) boolean
isGenerated
(MethodNode node) boolean
void
makeDynamic
(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.void
Instructs the type checker that a property access is dynamic, returning an instance of an Object.void
makeDynamic
(PropertyExpression pexp, ClassNode returnType) Instructs the type checker that a property access is dynamic.void
Instructs the type checker that an unresolved variable is a dynamic variable of type Object.void
makeDynamic
(VariableExpression vexp, ClassNode returnType) Instructs the type checker that an unresolved variable is a dynamic variable.org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope
newScope()
org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope
void
void
pushEnclosingBinaryExpression
(BinaryExpression binaryExpression) void
pushEnclosingClassNode
(ClassNode classNode) void
pushEnclosingClosureExpression
(ClosureExpression closureExpression) void
pushEnclosingMethod
(MethodNode methodNode) void
void
protected Object
org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope
org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope
void
setHandled
(boolean handled) unique
(MethodNode node) <R> R
withTypeChecker
(Closure<R> code) 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, getTargetMethod, getType, handleAmbiguousMethods, handleIncompatibleAssignment, handleIncompatibleReturnType, handleMissingMethod, handleUnresolvedAttribute, handleUnresolvedProperty, handleUnresolvedVariableExpression, isStaticMethodCallOnClass, lookupClassNodeFor, onMethodSelection, parameterizedType, setup, storeType
-
Field Details
-
context
-
handled
protected boolean handled -
debug
protected boolean debug
-
-
Constructor Details
-
AbstractTypeCheckingExtension
-
-
Method Details
-
setHandled
public void setHandled(boolean handled) -
newScope
public org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope newScope() -
newScope
public org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope newScope(Closure code) -
scopeExit
public org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope scopeExit() -
getCurrentScope
public org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope getCurrentScope() -
scopeExit
public org.codehaus.groovy.transform.stc.AbstractTypeCheckingExtension.TypeCheckingScope scopeExit(Closure code) -
isGenerated
-
unique
-
newMethod
-
newMethod
-
newMethod
-
delegatesTo
-
delegatesTo
-
delegatesTo
public 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
-
withTypeChecker
-
makeDynamic
Used 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
-
makeDynamic
Used 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 callreturnType
- the expected return type of the dynamic call- Returns:
- a virtual method node with the same name as the expected call
-
makeDynamic
Instructs 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
-
makeDynamic
Instructs 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 expressionreturnType
- the type of the property
-
makeDynamic
Instructs 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
-
makeDynamic
Instructs 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
-
popTemporaryTypeInfo
public void popTemporaryTypeInfo() -
pushEnclosingClassNode
-
popEnclosingBinaryExpression
-
getEnclosingClassNodes
-
getEnclosingClosureStack
-
popEnclosingClassNode
-
pushEnclosingMethod
-
getGeneratedMethods
-
getEnclosingBinaryExpressionStack
-
getEnclosingClosure
-
getEnclosingMethodCalls
-
pushEnclosingMethodCall
-
popEnclosingClosure
-
pushTemporaryTypeInfo
public void pushTemporaryTypeInfo()
-