public final class MethodTypeResolution
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
static JavaTypeDefinition |
boxPrimitive(JavaTypeDefinition def) |
|
static boolean |
checkSubtypeability(MethodType method,
MethodType subtypeableMethod) |
|
static java.util.List<MethodType> |
getApplicableMethods(JavaTypeDefinition context,
java.lang.String methodName,
java.util.List<JavaTypeDefinition> typeArguments,
int argArity,
java.lang.Class<?> accessingClass) |
Looks for potentially applicable methods in a given type definition.
|
static int |
getArity(java.lang.reflect.Method method) |
|
static JavaTypeDefinition |
getBestMethodReturnType(JavaTypeDefinition context,
java.util.List<MethodType> methods,
ASTArgumentList arguments) |
Searches a list of methods by trying the three phases of method overload resolution.
|
static java.util.List<JavaTypeDefinition> |
getMethodExplicitTypeArugments(net.sourceforge.pmd.lang.ast.Node node) |
|
static MethodType |
getTypeDefOfMethod(JavaTypeDefinition context,
java.lang.reflect.Method method,
java.util.List<JavaTypeDefinition> typeArguments) |
|
static boolean |
isGeneric(java.lang.Class<?> clazz) |
|
static boolean |
isGeneric(java.lang.reflect.Method method) |
|
static boolean |
isMemberVisibleFromClass(java.lang.Class<?> classWithMember,
int modifiers,
java.lang.Class<?> accessingClass) |
Given a class, the modifiers of on of it's member and the class that is trying to access that member,
returns true is the member is accessible from the accessingClass Class.
|
static boolean |
isMethodApplicable(java.lang.reflect.Method method,
java.lang.String methodName,
int argArity,
java.lang.Class<?> accessingClass,
java.util.List<JavaTypeDefinition> typeArguments) |
https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.12.2.1
Potential applicability.
|
static boolean |
isMethodConvertible(JavaTypeDefinition parameter,
ASTExpression argument) |
|
static boolean |
isMethodConvertible(JavaTypeDefinition parameter,
JavaTypeDefinition argument) |
Method invocation conversion rules.
|
static boolean |
isSubtypeable(java.lang.Class<?> parameter,
java.lang.Class<?> argument) |
|
static boolean |
isSubtypeable(JavaTypeDefinition parameter,
ASTExpression argument) |
|
static boolean |
isSubtypeable(JavaTypeDefinition parameter,
JavaTypeDefinition argument) |
Subtypeability rules.
|
static MethodType |
parameterizeInvocation(JavaTypeDefinition context,
java.lang.reflect.Method method,
ASTArgumentList argList) |
|
static void |
produceInitialBounds(java.lang.reflect.Method method,
JavaTypeDefinition context,
java.util.List<Variable> variables,
java.util.List<Bound> initialBounds) |
|
static java.util.List<Constraint> |
produceInitialConstraints(java.lang.reflect.Method method,
ASTArgumentList argList,
java.util.List<Variable> variables) |
|
static MethodType |
selectAmongMaximallySpecific(MethodType first,
MethodType second) |
Select maximally specific method.
|
static java.util.List<MethodType> |
selectMethodsFirstPhase(JavaTypeDefinition context,
java.util.List<MethodType> methodsToSearch,
ASTArgumentList argList) |
Look for methods be subtypeability.
|
static java.util.List<MethodType> |
selectMethodsSecondPhase(java.util.List<MethodType> methodsToSearch,
ASTArgumentList argList) |
Look for methods be method conversion.
|
static java.util.List<MethodType> |
selectMethodsThirdPhase(java.util.List<MethodType> methodsToSearch,
ASTArgumentList argList) |
Look for methods considering varargs as well.
|
static MethodType |
selectMostSpecificMethod(java.util.List<MethodType> selectedMethods) |
Most specific method selection.
|
public static boolean checkSubtypeability(MethodType method, MethodType subtypeableMethod)
public static java.util.List<MethodType> selectMethodsFirstPhase(JavaTypeDefinition context, java.util.List<MethodType> methodsToSearch, ASTArgumentList argList)
public static MethodType parameterizeInvocation(JavaTypeDefinition context, java.lang.reflect.Method method, ASTArgumentList argList)
public static java.util.List<Constraint> produceInitialConstraints(java.lang.reflect.Method method, ASTArgumentList argList, java.util.List<Variable> variables)
public static void produceInitialBounds(java.lang.reflect.Method method, JavaTypeDefinition context, java.util.List<Variable> variables, java.util.List<Bound> initialBounds)
public static java.util.List<MethodType> selectMethodsSecondPhase(java.util.List<MethodType> methodsToSearch, ASTArgumentList argList)
public static java.util.List<MethodType> selectMethodsThirdPhase(java.util.List<MethodType> methodsToSearch, ASTArgumentList argList)
public static JavaTypeDefinition getBestMethodReturnType(JavaTypeDefinition context, java.util.List<MethodType> methods, ASTArgumentList arguments)
public static MethodType selectMostSpecificMethod(java.util.List<MethodType> selectedMethods)
public static MethodType selectAmongMaximallySpecific(MethodType first, MethodType second)
public static java.util.List<MethodType> getApplicableMethods(JavaTypeDefinition context, java.lang.String methodName, java.util.List<JavaTypeDefinition> typeArguments, int argArity, java.lang.Class<?> accessingClass)
public static MethodType getTypeDefOfMethod(JavaTypeDefinition context, java.lang.reflect.Method method, java.util.List<JavaTypeDefinition> typeArguments)
public static boolean isMethodApplicable(java.lang.reflect.Method method, java.lang.String methodName, int argArity, java.lang.Class<?> accessingClass, java.util.List<JavaTypeDefinition> typeArguments)
public static boolean isMemberVisibleFromClass(java.lang.Class<?> classWithMember, int modifiers, java.lang.Class<?> accessingClass)
classWithMember
- The Class with the member.modifiers
- The modifiers of that member.accessingClass
- The Class trying to access the member.public static boolean isGeneric(java.lang.reflect.Method method)
public static boolean isGeneric(java.lang.Class<?> clazz)
public static int getArity(java.lang.reflect.Method method)
public static boolean isMethodConvertible(JavaTypeDefinition parameter, ASTExpression argument)
public static boolean isMethodConvertible(JavaTypeDefinition parameter, JavaTypeDefinition argument)
public static boolean isSubtypeable(JavaTypeDefinition parameter, ASTExpression argument)
public static boolean isSubtypeable(java.lang.Class<?> parameter, java.lang.Class<?> argument)
public static boolean isSubtypeable(JavaTypeDefinition parameter, JavaTypeDefinition argument)
public static JavaTypeDefinition boxPrimitive(JavaTypeDefinition def)
public static java.util.List<JavaTypeDefinition> getMethodExplicitTypeArugments(net.sourceforge.pmd.lang.ast.Node node)
Copyright © 2002–2018 PMD. All rights reserved.