Groovy 2.1.0-rc-1

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, String scriptPath)

 
Method Summary
void afterMethodCall(MethodCall call)

void afterVisitClass(ClassNode node)

void afterVisitMethod(MethodNode node)

boolean 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)

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, Class... classes)

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

ArgumentListExpression getArguments(MethodCall call)

GroovyTypeCheckingExtensionSupport.TypeCheckingScope getCurrentScope()

BinaryExpression getEnclosingBinaryExpression()

List getEnclosingBinaryExpressionStack()

ClassNode getEnclosingClassNode()

List getEnclosingClassNodes()

EnclosingClosure getEnclosingClosure()

List getEnclosingClosureStack()

MethodNode getEnclosingMethod()

Expression getEnclosingMethodCall()

List getEnclosingMethodCalls()

List getEnclosingMethods()

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

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

boolean handleUnresolvedAttribute(AttributeExpression aexp)

boolean handleUnresolvedProperty(PropertyExpression pexp)

boolean handleUnresolvedVariableExpression(VariableExpression vexp)

boolean isAnnotatedBy(ASTNode node, Class annotation)

boolean isAnnotatedBy(ASTNode node, ClassNode annotation)

boolean isDynamic(VariableExpression var)

boolean isExtensionMethod(MethodNode node)

boolean isGenerated(MethodNode node)

boolean isMethodCall(Object o)

MethodNode newMethod(String name, Class returnType)

MethodNode newMethod(String name, ClassNode returnType)

MethodNode newMethod(String name, 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()

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, onMethodSelection, parameterizedType, setup, storeType
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

GroovyTypeCheckingExtensionSupport

public GroovyTypeCheckingExtensionSupport(StaticTypeCheckingVisitor typeCheckingVisitor, String scriptPath)


 
Method Detail

afterMethodCall

for (Closure closure : onMethodSelection) {
public void afterMethodCall(MethodCall call)


afterVisitClass

for (Closure closure : list) {
public void afterVisitClass(ClassNode node)


afterVisitMethod

for (Closure closure : list) {
public void afterVisitMethod(MethodNode node)


argTypeMatches

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


argTypeMatches

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


argTypesMatches

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


argTypesMatches

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


beforeMethodCall

if (onMethodSelection != null) {
public boolean beforeMethodCall(MethodCall call)


beforeVisitClass

if (list != null) {
public boolean beforeVisitClass(ClassNode node)


beforeVisitMethod

if (list != null) {
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

for (Closure closure : list) {
public void finish()


firstArgTypesMatches

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


firstArgTypesMatches

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


getArguments

public ArgumentListExpression getArguments(MethodCall call)


getCurrentScope

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope getCurrentScope()


getEnclosingBinaryExpression

public BinaryExpression getEnclosingBinaryExpression()


getEnclosingBinaryExpressionStack

public List getEnclosingBinaryExpressionStack()


getEnclosingClassNode

public ClassNode getEnclosingClassNode()


getEnclosingClassNodes

public List getEnclosingClassNodes()


getEnclosingClosure

public EnclosingClosure getEnclosingClosure()


getEnclosingClosureStack

public List getEnclosingClosureStack()


getEnclosingMethod

public MethodNode getEnclosingMethod()


getEnclosingMethodCall

public Expression getEnclosingMethodCall()


getEnclosingMethodCalls

public List getEnclosingMethodCalls()


getEnclosingMethods

public List getEnclosingMethods()


handleIncompatibleAssignment

if (list != null) {
public boolean handleIncompatibleAssignment(ClassNode lhsType, ClassNode rhsType, Expression assignmentExpression)


handleMissingMethod

List methodList = new LinkedList();
if (onMethodSelection != null) {
public List handleMissingMethod(ClassNode receiver, String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call)


handleUnresolvedAttribute

if (list != null) {
public boolean handleUnresolvedAttribute(AttributeExpression aexp)


handleUnresolvedProperty

if (list != null) {
public boolean handleUnresolvedProperty(PropertyExpression pexp)


handleUnresolvedVariableExpression

if (onMethodSelection != null) {
public boolean handleUnresolvedVariableExpression(VariableExpression vexp)


isAnnotatedBy

public boolean isAnnotatedBy(ASTNode node, 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(Object o)


newMethod

public MethodNode newMethod(String name, Class returnType)


newMethod

public MethodNode newMethod(String name, ClassNode returnType)


newMethod

public MethodNode newMethod(String name, Callable returnType)


newScope

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope newScope()


newScope

public GroovyTypeCheckingExtensionSupport.TypeCheckingScope newScope(Closure code)


onMethodSelection

for (Closure closure : onMethodSelection) {
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 List unique(MethodNode node)


withTypeChecker

clone.setResolveStrategy(Closure.DELEGATE_FIRST);
public R withTypeChecker(Closure code)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.