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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedReferenceTypeDeclaration
declaringType()
List<ResolvedType>
exceptionTypes()
ResolvedMethodDeclaration
getDeclaration()
String
getName()
int
getNoParams()
Return the number of formal arguments accepted by this method.ResolvedType
getParamType(int i)
Return the type of the formal argument at the given position.List<ResolvedType>
getParamTypes()
String
getQualifiedSignature()
MethodUsage
replaceExceptionType(int i, ResolvedType replaced)
MethodUsage
replaceParamType(int i, ResolvedType replaced)
MethodUsage
replaceReturnType(ResolvedType returnType)
MethodUsage
replaceTypeParameter(ResolvedTypeParameterDeclaration typeParameter, ResolvedType type)
ResolvedType
returnType()
String
toString()
ResolvedTypeParametersMap
typeParametersMap()
-
-
-
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()
-
exceptionTypes
public List<ResolvedType> exceptionTypes()
-
-