|
Groovy 2.0.0-rc-3 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.transform.stc.StaticTypeCheckingSupport
public abstract class StaticTypeCheckingSupport extends Object
Static support methods for StaticTypeCheckingVisitor.
Method Summary | |
---|---|
static int
|
allParametersAndArgumentsMatch(Parameter[] params, ClassNode[] args)
Checks that arguments and parameter types match. |
static boolean
|
checkCompatibleAssignmentTypes(ClassNode left, ClassNode right)
Returns true or false depending on whether the right classnode can be assigned to the left classnode. |
static boolean
|
checkCompatibleAssignmentTypes(ClassNode left, ClassNode right, Expression rightExpression)
|
static List
|
chooseBestMethod(ClassNode receiver, Collection methods, ClassNode... args)
Given a list of candidate methods, returns the one which best matches the argument types |
static List
|
findDGMMethodsByNameAndArguments(ClassNode receiver, String name, ClassNode[] args)
|
static List
|
findDGMMethodsByNameAndArguments(ClassNode receiver, String name, ClassNode[] args, List methods)
|
static boolean
|
implementsInterfaceOrIsSubclassOf(ClassNode type, ClassNode superOrInterface)
|
static boolean
|
isAssignment(int op)
|
static boolean
|
isWithCall(String name, Expression callArguments)
Called on method call checks in order to determine if a method call corresponds to the idiomatic o.with { ... } structure |
static Parameter[]
|
parameterizeArguments(ClassNode receiver, MethodNode m)
A DGM-like method which adds support for method calls which are handled specifically by the Groovy compiler. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail |
---|
public static int allParametersAndArgumentsMatch(Parameter[] params, ClassNode[] args)
params
- method parametersargs
- type arguments
public static boolean checkCompatibleAssignmentTypes(ClassNode left, ClassNode right)
left
- the class to be assigned toright
- the assignee class
public static boolean checkCompatibleAssignmentTypes(ClassNode left, ClassNode right, Expression rightExpression)
public static List chooseBestMethod(ClassNode receiver, Collection methods, ClassNode... args)
methods
- candidate methodsargs
- argument types
public static List findDGMMethodsByNameAndArguments(ClassNode receiver, String name, ClassNode[] args)
public static List findDGMMethodsByNameAndArguments(ClassNode receiver, String name, ClassNode[] args, List methods)
public static boolean implementsInterfaceOrIsSubclassOf(ClassNode type, ClassNode superOrInterface)
public static boolean isAssignment(int op)
public static boolean isWithCall(String name, Expression callArguments)
name
- name of the method calledcallArguments
- arguments of the method
public static Parameter[] parameterizeArguments(ClassNode receiver, MethodNode m)
Copyright © 2003-2012 The Codehaus. All rights reserved.