| Modifier and Type | Field and Description |
|---|---|
| protected final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | afterMethodCall(final MethodCall call)
Overrides org. |
| public void | afterVisitClass(final ClassNode
a class node node)Overrides org. |
| public void | afterVisitMethod(final MethodNode
a method node node)Overrides org. |
| public boolean | beforeMethodCall(final MethodCall call)
Overrides org. |
| public boolean | beforeVisitClass(final ClassNode
a class node node)Overrides org. |
| public boolean | beforeVisitMethod(final MethodNode
a method node node)Overrides org. |
| public void | finish()
Overrides org. |
| public List | handleAmbiguousMethods(final List<MethodNode>
the list of ambiguous methods nodes, final Expression the expression which originated the method selection process origin)Overrides org. |
| public boolean | handleIncompatibleAssignment(final ClassNode
the type of the left hand side of the assignment, as found by the type checker lhsType, final ClassNode the type of the right hand side of the assignment, as found by the type checker rhsType, final Expression the assignment expression which triggered this call assignmentExpression)Overrides org. |
| public boolean | handleIncompatibleReturnType(ReturnStatement
the statement that triggered the error returnStatement, ClassNode the inferred return type for this statement inferredReturnType)Overrides org. |
| public List | handleMissingMethod(final ClassNode
the type of the receiver receiver, final String the name of the called method name, final ArgumentListExpression the list of arguments of the call argumentList, final ClassNode[] the types of the arguments of the call argumentTypes, final MethodCall the method call itself, if needed call)Overrides org. |
| public boolean | handleUnresolvedAttribute(final AttributeExpression
the unresolved attribute aexp)Overrides org. |
| public boolean | handleUnresolvedProperty(final PropertyExpression
the unresolved property pexp)Overrides org. |
| public boolean | handleUnresolvedVariableExpression(VariableExpression
the unresolved variable extension vexp)Overrides org. |
| public void | onMethodSelection(final Expression
the expression for which a corresponding method has been found expression, final MethodNode the method which has been chosen by the type checker target)Overrides org. |
| public void | |
| public void | setup()
Overrides org. |
| handlers | back to summary |
|---|---|
| protected final List<TypeCheckingExtension> handlers | |
| DefaultTypeCheckingExtension | back to summary |
|---|---|
| public DefaultTypeCheckingExtension(final StaticTypeCheckingVisitor typeCheckingVisitor) | |
| addHandler | back to summary |
|---|---|
| public void addHandler(TypeCheckingExtension handler) | |
| afterMethodCall | back to summary |
|---|---|
| public void afterMethodCall(final MethodCall call) Overrides org. Doc from org. Allows the extension to perform additional tasks after the type checker actually visits a method call.
Compared to a custom visitor, this method ensures that the node being visited is a node which would have
been visited by the type checker. This is in particular important for nodes which are marked with
| |
| afterVisitClass | back to summary |
|---|---|
| public void afterVisitClass(final ClassNode node) Overrides org. Doc from org. Allows the extension to perform additional tasks after the type checker actually visited a class node.
Compared to a custom visitor, this method ensures that the node being visited is a node which would have
been visited by the type checker. This is in particular important for nodes which are marked with
| |
| afterVisitMethod | back to summary |
|---|---|
| public void afterVisitMethod(final MethodNode node) Overrides org. Doc from org. Allows the extension to perform additional tasks after the type checker actually visited a method node.
Compared to a custom visitor, this method ensures that the node being visited is a node which would have
been visited by the type checker. This is in particular important for nodes which are marked with
| |
| beforeMethodCall | back to summary |
|---|---|
| public boolean beforeMethodCall(final MethodCall call) Overrides org. Doc from org. Allows the extension to perform additional tasks before the type checker actually visits a method call.
Compared to a custom visitor, this method ensures that the node being visited is a node which would have
been visited by the type checker. This is in particular important for nodes which are marked with
| |
| beforeVisitClass | back to summary |
|---|---|
| public boolean beforeVisitClass(final ClassNode node) Overrides org. Doc from org. Allows the extension to perform additional tasks before the type checker actually visits a class node.
Compared to a custom visitor, this method ensures that the node being visited is a node which would have
been visited by the type checker. This is in particular important for nodes which are marked with
| |
| beforeVisitMethod | back to summary |
|---|---|
| public boolean beforeVisitMethod(final MethodNode node) Overrides org. Doc from org. Allows the extension to perform additional tasks before the type checker actually visits a method node.
Compared to a custom visitor, this method ensures that the node being visited is a node which would have
been visited by the type checker. This is in particular important for nodes which are marked with
| |
| finish | back to summary |
|---|---|
| public void finish() Overrides org. Doc from org. Subclasses should implement this method if they need to perform additional checks after the type checker has finished its work. This is particularly useful for situations where you need multiple passes. Some checks in that case may be deferred to the end, using this method.
| |
| handleAmbiguousMethods | back to summary |
|---|---|
| public List Overrides org. Doc from org. This method is called by the type checker before throwing an "ambiguous method" error, giving the chance to the extension to select the method properly. This means that when this method is called, the "nodes" parameter contains at least two methods. If the returned list still contains at least two methods, then the type checker will throw an ambiguous method call error. If the returned method contains 1 element, then the type checker will not throw any error. It is invalid to return an empty list.
| |
| handleIncompatibleAssignment | back to summary |
|---|---|
| public boolean handleIncompatibleAssignment(final ClassNode lhsType, final ClassNode rhsType, final Expression assignmentExpression) Overrides org. Doc from org. This method is called by the type checker when an assignment is not allowed by the type checker. Extensions may override this method to allow such assignments where the type checker normally disallows them.
| |
| handleIncompatibleReturnType | back to summary |
|---|---|
| public boolean handleIncompatibleReturnType(ReturnStatement returnStatement, ClassNode inferredReturnType) Overrides org. Doc from org. Allows the extension to catch incompatible return types. This event is called whenever the type checker finds that an inferred return type is incompatible with the declared return type of a method.
| |
| handleMissingMethod | back to summary |
|---|---|
| public List Overrides org. Doc from org. This method is called by the type checker when a method call cannot be resolved. Extensions may override this method to handle missing methods and prevent the type checker from throwing an error.
| |
| handleUnresolvedAttribute | back to summary |
|---|---|
| public boolean handleUnresolvedAttribute(final AttributeExpression aexp) Overrides org. Doc from org. This method is called by the type checker when an attribute expression cannot be resolved (for example, when an attribute doesn't exist). It gives the extension a chance to resolve it.
| |
| handleUnresolvedProperty | back to summary |
|---|---|
| public boolean handleUnresolvedProperty(final PropertyExpression pexp) Overrides org. Doc from org. This method is called by the type checker when a property expression cannot be resolved (for example, when a property doesn't exist). It gives the extension a chance to resolve it.
| |
| handleUnresolvedVariableExpression | back to summary |
|---|---|
| public boolean handleUnresolvedVariableExpression(VariableExpression vexp) Overrides org. Doc from org. This method is called by the type checker when a variable expression cannot be resolved. It gives the extension a chance to resolve it for the type checker.
| |
| onMethodSelection | back to summary |
|---|---|
| public void onMethodSelection(final Expression expression, final MethodNode target) Overrides org. Doc from org. Allows the extension to listen to method selection events. Given an expression, which may be a method call expression, a static method call expression, a pre/postfix expression, ..., if a corresponding method is found, this method is called.
| |
| removeHandler | back to summary |
|---|---|
| public void removeHandler(TypeCheckingExtension handler) | |
| setup | back to summary |
|---|---|
| public void setup() Overrides org. Doc from org. Subclasses should implement this method whenever they need to perform special checks before the type checker starts working.
| |