public class StaticCompilationVisitor extends StaticTypeCheckingVisitor
StaticTypeCheckingVisitor.SignatureCodec, StaticTypeCheckingVisitor.SignatureCodecFactory
Modifier and Type | Field and Description |
---|---|
static MethodNode |
ARRAYLIST_ADD_METHOD |
static ClassNode |
ARRAYLIST_CLASSNODE |
static MethodNode |
ARRAYLIST_CONSTRUCTOR |
CLOSURE_CALL_NO_ARG, CLOSURE_CALL_ONE_ARG, CLOSURE_CALL_VARGS
Constructor and Description |
---|
StaticCompilationVisitor(SourceUnit unit,
ClassNode node,
TypeCheckerPluginFactory pluginFactory) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
existsProperty(PropertyExpression pexp,
boolean checkForReadOnly,
ClassCodeVisitorSupport visitor)
Checks whether a property exists on the receiver, or on any of the possible receiver classes (found in the
temporary type information table)
|
protected MethodNode |
findMethodOrFail(Expression expr,
ClassNode receiver,
java.lang.String name,
ClassNode... args) |
protected ClassNode[] |
getTypeCheckingAnnotations()
Returns the list of type checking annotations class nodes.
|
static boolean |
isStaticallyCompiled(AnnotatedNode node) |
void |
visitBinaryExpression(BinaryExpression expression) |
void |
visitClass(ClassNode node)
Visit a ClassNode.
|
void |
visitConstructorCallExpression(ConstructorCallExpression call) |
void |
visitForLoop(ForStatement forLoop) |
void |
visitMethod(MethodNode node)
Visit a MethodNode.
|
void |
visitMethodCallExpression(MethodCallExpression call) |
void |
visitSpreadExpression(SpreadExpression expression) |
addError, addStaticTypeError, addTypeCheckingInfoAnnotation, getSourceUnit, getType, hasSetter, inferComponentType, inferLoopElementType, isSkipMode, performSecondPass, setErrorCollector, setMethodsToBeVisited, shouldSkipClassNode, shouldSkipMethodNode, visitAttributeExpression, visitBitwiseNegationExpression, visitCastExpression, visitClassExpression, visitClosureExpression, visitConstructorOrMethod, visitField, visitIfElse, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitStaticMethodCallExpression, visitTernaryExpression, visitTryCatchFinally, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop
visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, visitConstructor, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitImports, visitObjectInitializerStatements, visitPackage, visitProperty, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement
visitArgumentlistExpression, visitArrayExpression, visitBooleanExpression, visitBytecodeExpression, visitClosureListExpression, visitConstantExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitNotExpression, visitShortTernaryExpression, visitSpreadMapExpression, visitTupleExpression
public static final ClassNode ARRAYLIST_CLASSNODE
public static final MethodNode ARRAYLIST_CONSTRUCTOR
public static final MethodNode ARRAYLIST_ADD_METHOD
public StaticCompilationVisitor(SourceUnit unit, ClassNode node, TypeCheckerPluginFactory pluginFactory)
protected ClassNode[] getTypeCheckingAnnotations()
StaticTypeCheckingVisitor
TypeChecked
.getTypeCheckingAnnotations
in class StaticTypeCheckingVisitor
public static boolean isStaticallyCompiled(AnnotatedNode node)
public void visitClass(ClassNode node)
GroovyClassVisitor
visitClass
in interface GroovyClassVisitor
visitClass
in class StaticTypeCheckingVisitor
public void visitMethod(MethodNode node)
GroovyClassVisitor
visitMethod
in interface GroovyClassVisitor
visitMethod
in class StaticTypeCheckingVisitor
public void visitSpreadExpression(SpreadExpression expression)
visitSpreadExpression
in interface GroovyCodeVisitor
visitSpreadExpression
in class CodeVisitorSupport
public void visitMethodCallExpression(MethodCallExpression call)
visitMethodCallExpression
in interface GroovyCodeVisitor
visitMethodCallExpression
in class StaticTypeCheckingVisitor
public void visitConstructorCallExpression(ConstructorCallExpression call)
visitConstructorCallExpression
in interface GroovyCodeVisitor
visitConstructorCallExpression
in class StaticTypeCheckingVisitor
public void visitForLoop(ForStatement forLoop)
visitForLoop
in interface GroovyCodeVisitor
visitForLoop
in class StaticTypeCheckingVisitor
protected MethodNode findMethodOrFail(Expression expr, ClassNode receiver, java.lang.String name, ClassNode... args)
findMethodOrFail
in class StaticTypeCheckingVisitor
protected boolean existsProperty(PropertyExpression pexp, boolean checkForReadOnly, ClassCodeVisitorSupport visitor)
StaticTypeCheckingVisitor
existsProperty
in class StaticTypeCheckingVisitor
pexp
- a property expressioncheckForReadOnly
- also lookup for read only propertiesvisitor
- if not null, when the property node is found, visit it with the provided visitorpublic void visitBinaryExpression(BinaryExpression expression)
visitBinaryExpression
in interface GroovyCodeVisitor
visitBinaryExpression
in class StaticTypeCheckingVisitor