Groovy Documentation

org.codehaus.groovy.transform.stc
[Java] Class GroovyTypeCheckingExtensionSupport

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

public class GroovyTypeCheckingExtensionSupport
extends TypeCheckingExtension

Base class for type checking extensions written in Groovy. Compared to its superclass, TypeCheckingExtension, this class adds a number of utility methods aimed at leveraging the syntax of the Groovy language to improve expressivity and conciseness.

Authors:
Cedric Champeau
Since:
2.1.0


Nested Class Summary
static class GroovyTypeCheckingExtensionSupport.TypeCheckingDSL

 
Field Summary
 
Fields inherited from class TypeCheckingExtension
typeCheckingVisitor
 
Constructor Summary
GroovyTypeCheckingExtensionSupport(StaticTypeCheckingVisitor typeCheckingVisitor, java.lang.String scriptPath)

 
Method Summary
void afterMethodCall(MethodCall call)

void afterVisitClass(ClassNode node)

void afterVisitMethod(MethodNode node)

boolean argTypeMatches(ClassNode[] argTypes, int index, java.lang.Class clazz)

boolean argTypeMatches(MethodCall call, int index, java.lang.Class clazz)

boolean argTypesMatches(ClassNode[] argTypes, java.lang.Class... classes)

boolean argTypesMatches(MethodCall call, java.lang.Class... classes)

boolean beforeMethodCall(MethodCall call)

boolean beforeVisitClass(ClassNode node)

boolean beforeVisitMethod(MethodNode node)

void delegatesTo(ClassNode type)

void delegatesTo(ClassNode type, int strategy)

void delegatesTo(ClassNode type, int strategy, DelegationMetadata parent)

void finish()

boolean firstArgTypesMatches(ClassNode[] argTypes, java.lang.Class... classes)

boolean firstArgTypesMatches(MethodCall call, java.lang.Class... classes)

ArgumentListExpression getArguments(MethodCall call)

GroovyTypeCheckingExtensionSupport.TypeCheckingScope getCurrentScope()

BinaryExpression getEnclosingBinaryExpression()

java.util.List getEnclosingBinaryExpressionStack()

ClassNode getEnclosingClassNode()

java.util.List getEnclosingClassNodes()

EnclosingClosure getEnclosingClosure()

java.util.List getEnclosingClosureStack()

MethodNode getEnclosingMethod()

Expression getEnclosingMethodCall()

java.util.List getEnclosingMethodCalls()

java.util.List getEnclosingMethods()

boolean handleIncompatibleAssignment(ClassNode lhsType, ClassNode rhsType, Expression assignmentExpression)

java.util.List handleMissingMethod(ClassNode receiver, java.lang.String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call)

boolean handleUnresolvedAttribute(AttributeExpression aexp)

boolean handleUnresolvedProperty(PropertyExpression pexp)

boolean handleUnresolvedVariableExpression(VariableExpression vexp)

boolean isAnnotatedBy(ASTNode node, java.lang.Class annotation)

boolean isAnnotatedBy(ASTNode node, ClassNode annotation)

boolean isDynamic(VariableExpression var)

boolean isExtensionMethod(MethodNode node)

boolean isGenerated(MethodNode node)

boolean isMethodCall(java.lang.Object o)

MethodNode newMethod(java.lang.String name, java.lang.Class returnType)

MethodNode newMethod(java.lang.String name, ClassNode returnType)

MethodNode newMethod(java.lang.String name, java.util.concurrent.Callable returnType)

GroovyTypeCheckingExtensionSupport.TypeCheckingScope newScope()

GroovyTypeCheckingExtensionSupport.TypeCheckingScope newScope(Closure code)

void onMethodSelection(Expression expression, MethodNode target)

BinaryExpression popEnclosingBinaryExpression()

ClassNode popEnclosingClassNode()

EnclosingClosure popEnclosingClosure()

MethodNode popEnclosingMethod()

Expression popEnclosingMethodCall()

void popTemporaryTypeInfo()

void pushEnclosingBinaryExpression(BinaryExpression binaryExpression)

void pushEnclosingClassNode(ClassNode classNode)

void pushEnclosingClosureExpression(ClosureExpression closureExpression)

void pushEnclosingMethod(MethodNode methodNode)

void pushEnclosingMethodCall(Expression call)

void pushTemporaryTypeInfo()

GroovyTypeCheckingExtensionSupport.TypeCheckingScope scopeExit()

GroovyTypeCheckingExtensionSupport.TypeCheckingScope scopeExit(Closure code)

void setHandled(boolean handled)

void setup()

java.util.List unique(MethodNode node)

R withTypeChecker(Closure code)

 
Methods inherited from class TypeCheckingExtension
addStaticTypeError, afterMethodCall, afterVisitClass, afterVisitMethod, beforeMethodCall, beforeVisitClass, beforeVisitMethod, classNodeFor, classNodeFor, existsProperty, existsProperty, finish, getArgumentTypes, getTargetMethod, getType, handleIncompatibleAssignment, handleMissingMethod, handleUnresolvedAttribute, handleUnresolvedProperty, handleUnresolvedVariableExpression, lookupClassNodeFor, onMethodSelection, parameterizedType, setup, storeType
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

GroovyTypeCheckingExtensionSupport

public GroovyTypeCheckingExtensionSupport(StaticTypeCheckingVisitor typeCheckingVisitor, java.lang.String scriptPath)


 
Method Detail

afterMethodCall

safeCall(closure, call);
public void afterMethodCall(MethodCall call)


afterVisitClass

safeCall(closure, node);
public void afterVisitClass(ClassNode node)


afterVisitMethod

safeCall(closure, node);
public void afterVisitMethod(MethodNode node)


argTypeMatches

public boolean argTypeMatches(ClassNode[] argTypes, int index, java.lang.Class clazz)


argTypeMatches

public boolean argTypeMatches(MethodCall call, int index, java.lang.Class clazz)


argTypesMatches

public boolean argTypesMatches(ClassNode[] argTypes, java.lang.Class... classes)


argTypesMatches

public boolean argTypesMatches(MethodCall call, java.lang.Class... classes)


beforeMethodCall

for (Closure closure : onMethodSelection) {
public boolean beforeMethodCall(MethodCall call)


beforeVisitClass

for (Closure closure : list) {
public boolean beforeVisitClass(ClassNode node)


beforeVisitMethod

for (Closure closure : list) {
public boolean beforeVisitMethod(MethodNode node)


delegatesTo

public void delegatesTo(ClassNode type)


delegatesTo

public void delegatesTo(ClassNode type, int strategy)


delegatesTo

public void delegatesTo(ClassNode type, int strategy, DelegationMetadata parent)


finish

safeCall(closure);
public void finish()


firstArgTypesMatches

public boolean firstArgTypesMatches(ClassNode[] argTypes, java.lang.Class... classes)


firstArgTypesMatches

public boolean firstArgTypesMatches(MethodCall call, java.lang.Class... classes)


getArguments

public ArgumentListExpression getArguments(MethodCall call)


getCurrentScope

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope getCurrentScope()


getEnclosingBinaryExpression

public BinaryExpression getEnclosingBinaryExpression()


getEnclosingBinaryExpressionStack

public java.util.List getEnclosingBinaryExpressionStack()


getEnclosingClassNode

public ClassNode getEnclosingClassNode()


getEnclosingClassNodes

public java.util.List getEnclosingClassNodes()


getEnclosingClosure

public EnclosingClosure getEnclosingClosure()


getEnclosingClosureStack

public java.util.List getEnclosingClosureStack()


getEnclosingMethod

public MethodNode getEnclosingMethod()


getEnclosingMethodCall

public Expression getEnclosingMethodCall()


getEnclosingMethodCalls

public java.util.List getEnclosingMethodCalls()


getEnclosingMethods

public java.util.List getEnclosingMethods()


handleIncompatibleAssignment

for (Closure closure : list) {
public boolean handleIncompatibleAssignment(ClassNode lhsType, ClassNode rhsType, Expression assignmentExpression)


handleMissingMethod

if (onMethodSelection != null) {
for (Closure closure : onMethodSelection) {
public java.util.List handleMissingMethod(ClassNode receiver, java.lang.String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call)


handleUnresolvedAttribute

for (Closure closure : list) {
public boolean handleUnresolvedAttribute(AttributeExpression aexp)


handleUnresolvedProperty

for (Closure closure : list) {
public boolean handleUnresolvedProperty(PropertyExpression pexp)


handleUnresolvedVariableExpression

for (Closure closure : onMethodSelection) {
public boolean handleUnresolvedVariableExpression(VariableExpression vexp)


isAnnotatedBy

public boolean isAnnotatedBy(ASTNode node, java.lang.Class annotation)


isAnnotatedBy

public boolean isAnnotatedBy(ASTNode node, ClassNode annotation)


isDynamic

public boolean isDynamic(VariableExpression var)


isExtensionMethod

public boolean isExtensionMethod(MethodNode node)


isGenerated

public boolean isGenerated(MethodNode node)


isMethodCall

public boolean isMethodCall(java.lang.Object o)


newMethod

public MethodNode newMethod(java.lang.String name, java.lang.Class returnType)


newMethod

public MethodNode newMethod(java.lang.String name, ClassNode returnType)


newMethod

public MethodNode newMethod(java.lang.String name, java.util.concurrent.Callable returnType)


newScope

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope newScope()


newScope

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope newScope(Closure code)


onMethodSelection

safeCall(closure, expression, target);
public void onMethodSelection(Expression expression, MethodNode target)


popEnclosingBinaryExpression

public BinaryExpression popEnclosingBinaryExpression()


popEnclosingClassNode

public ClassNode popEnclosingClassNode()


popEnclosingClosure

public EnclosingClosure popEnclosingClosure()


popEnclosingMethod

public MethodNode popEnclosingMethod()


popEnclosingMethodCall

public Expression popEnclosingMethodCall()


popTemporaryTypeInfo

public void popTemporaryTypeInfo()


pushEnclosingBinaryExpression

public void pushEnclosingBinaryExpression(BinaryExpression binaryExpression)


pushEnclosingClassNode

public void pushEnclosingClassNode(ClassNode classNode)


pushEnclosingClosureExpression

public void pushEnclosingClosureExpression(ClosureExpression closureExpression)


pushEnclosingMethod

public void pushEnclosingMethod(MethodNode methodNode)


pushEnclosingMethodCall

public void pushEnclosingMethodCall(Expression call)


pushTemporaryTypeInfo

public void pushTemporaryTypeInfo()


scopeExit

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope scopeExit()


scopeExit

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope scopeExit(Closure code)


setHandled

public void setHandled(boolean handled)


setup

config.setScriptBaseClass("org.codehaus.groovy.transform.stc.GroovyTypeCheckingExtensionSupport.TypeCheckingDSL");
public void setup()


unique

public java.util.List unique(MethodNode node)


withTypeChecker

return clone.call();
public R withTypeChecker(Closure code)


 

Groovy Documentation