public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport
The main class code visitor responsible for static type checking. It will perform various inspections like checking assignment types, type inference, ... Eventually, class nodes may be annotated with inferred type information.
Modifiers | Name | Description |
---|---|---|
static class |
StaticTypeCheckingVisitor.SignatureCodecFactory |
Modifiers | Name | Description |
---|---|---|
static MethodNode |
CLOSURE_CALL_NO_ARG |
|
static MethodNode |
CLOSURE_CALL_ONE_ARG |
|
static MethodNode |
CLOSURE_CALL_VARGS |
|
static Statement |
GENERATED_EMPTY_STATEMENT |
Constructor and description |
---|
StaticTypeCheckingVisitor(SourceUnit source, ClassNode classNode) |
Given a method name and a prefix, returns the name of the property that should be looked up, following the java beans rules. For example, "getName" would return "name", while "getFullName" would return "fullName". If the prefix is not found, returns null.
prefix
- the method name prefix ("get", "is", "set", ...)methodName
- the method nameReturns the current type checking context. The context is used internally by the type checker during type checking to store various state data.
Returns the inferred loop element type given a loop collection type. Used,
for example, to infer the element type of a for (e in list)
loop.
collectionType
- the type of the collectionCopyright © 2003-2022 The Apache Software Foundation. All rights reserved.