Package com.github.javaparser.resolution
Class MethodUsage
- java.lang.Object
-
- com.github.javaparser.resolution.MethodUsage
-
- All Implemented Interfaces:
ResolvedTypeParametrized
public class MethodUsage extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description private ResolvedMethodDeclaration
declaration
private java.util.List<ResolvedType>
exceptionTypes
private java.util.List<ResolvedType>
paramTypes
private ResolvedType
returnType
private ResolvedTypeParametersMap
typeParametersMap
-
Constructor Summary
Constructors Modifier Constructor Description MethodUsage(ResolvedMethodDeclaration declaration)
MethodUsage(ResolvedMethodDeclaration declaration, java.util.List<ResolvedType> paramTypes, ResolvedType returnType)
MethodUsage(ResolvedMethodDeclaration declaration, java.util.List<ResolvedType> paramTypes, ResolvedType returnType, java.util.List<ResolvedType> exceptionTypes)
private
MethodUsage(ResolvedMethodDeclaration declaration, java.util.List<ResolvedType> paramTypes, ResolvedType returnType, java.util.List<ResolvedType> exceptionTypes, ResolvedTypeParametersMap typeParametersMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedReferenceTypeDeclaration
declaringType()
java.util.List<ResolvedType>
exceptionTypes()
ResolvedMethodDeclaration
getDeclaration()
java.lang.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.java.util.List<ResolvedType>
getParamTypes()
java.lang.String
getQualifiedSignature()
The qualified signature of the method.java.lang.String
getSignature()
The signature of the method.MethodUsage
replaceExceptionType(int i, ResolvedType replaced)
MethodUsage
replaceParamType(int i, ResolvedType replaced)
MethodUsage
replaceReturnType(ResolvedType returnType)
MethodUsage
replaceTypeParameter(ResolvedTypeParameterDeclaration typeParameter, ResolvedType type)
ResolvedType
returnType()
java.lang.String
toString()
ResolvedTypeParametersMap
typeParametersMap()
-
-
-
Field Detail
-
declaration
private ResolvedMethodDeclaration declaration
-
paramTypes
private java.util.List<ResolvedType> paramTypes
-
exceptionTypes
private java.util.List<ResolvedType> exceptionTypes
-
returnType
private ResolvedType returnType
-
typeParametersMap
private ResolvedTypeParametersMap typeParametersMap
-
-
Constructor Detail
-
MethodUsage
public MethodUsage(ResolvedMethodDeclaration declaration)
-
MethodUsage
public MethodUsage(ResolvedMethodDeclaration declaration, java.util.List<ResolvedType> paramTypes, ResolvedType returnType)
-
MethodUsage
public MethodUsage(ResolvedMethodDeclaration declaration, java.util.List<ResolvedType> paramTypes, ResolvedType returnType, java.util.List<ResolvedType> exceptionTypes)
-
MethodUsage
private MethodUsage(ResolvedMethodDeclaration declaration, java.util.List<ResolvedType> paramTypes, ResolvedType returnType, java.util.List<ResolvedType> exceptionTypes, ResolvedTypeParametersMap typeParametersMap)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDeclaration
public ResolvedMethodDeclaration getDeclaration()
-
getName
public java.lang.String getName()
-
declaringType
public ResolvedReferenceTypeDeclaration declaringType()
-
returnType
public ResolvedType returnType()
-
getParamTypes
public java.util.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 java.lang.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 java.lang.String getSignature()
The signature of the method.
-
exceptionTypes
public java.util.List<ResolvedType> exceptionTypes()
-
-