Package com.github.javaparser.resolution
Class MethodUsage
- java.lang.Object
-
- com.github.javaparser.resolution.MethodUsage
-
- All Implemented Interfaces:
ResolvedTypeParametrized
public class MethodUsage extends Object implements ResolvedTypeParametrized
This is basically a MethodDeclaration with some TypeParameters defined. The defined TypeParameters can comes from the Method itself or from the surrounding types.- Author:
- Federico Tomassetti
-
-
Constructor Summary
Constructors Constructor Description MethodUsage(ResolvedMethodDeclaration declaration)
MethodUsage(ResolvedMethodDeclaration declaration, List<ResolvedType> paramTypes, ResolvedType returnType)
MethodUsage(ResolvedMethodDeclaration declaration, List<ResolvedType> paramTypes, ResolvedType returnType, List<ResolvedType> exceptionTypes)
-
Method Summary
-
-
-
Constructor Detail
-
MethodUsage
public MethodUsage(ResolvedMethodDeclaration declaration)
-
MethodUsage
public MethodUsage(ResolvedMethodDeclaration declaration, List<ResolvedType> paramTypes, ResolvedType returnType)
-
MethodUsage
public MethodUsage(ResolvedMethodDeclaration declaration, List<ResolvedType> paramTypes, ResolvedType returnType, List<ResolvedType> exceptionTypes)
-
-
Method Detail
-
getDeclaration
public ResolvedMethodDeclaration getDeclaration()
-
getName
public String getName()
-
declaringType
public ResolvedReferenceTypeDeclaration declaringType()
-
returnType
public ResolvedType returnType()
-
getParamTypes
public List<ResolvedType> getParamTypes()
-
replaceParamType
public MethodUsage replaceParamType(int i, ResolvedType replaced)
-
replaceExceptionType
public MethodUsage replaceExceptionType(int i, ResolvedType replaced)
-
replaceReturnType
public MethodUsage replaceReturnType(ResolvedType returnType)
-
getNoParams
public int getNoParams()
Return the number of formal arguments accepted by this method.
-
getParamType
public ResolvedType getParamType(int i)
Return the type of the formal argument at the given position.
-
replaceTypeParameter
public MethodUsage replaceTypeParameter(ResolvedTypeParameterDeclaration typeParameter, ResolvedType type)
-
typeParametersMap
public ResolvedTypeParametersMap typeParametersMap()
- Specified by:
typeParametersMap
in interfaceResolvedTypeParametrized
-
getQualifiedSignature
public String getQualifiedSignature()
The qualified signature of the method. It is composed by the qualified name of the declaring type followed by the signature of the method.
-
getSignature
public String getSignature()
The signature of the method.
-
getErasedSignature
public String getErasedSignature()
The erased signature of the method.
-
exceptionTypes
public List<ResolvedType> exceptionTypes()
-
isSameSignature
public boolean isSameSignature(MethodUsage otherMethodUsage)
-
isSubSignature
public boolean isSubSignature(MethodUsage otherMethodUsage)
-
isReturnTypeSubstituable
public boolean isReturnTypeSubstituable(MethodUsage otherMethodUsage)
-
-