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 ResolvedMethodDeclarationdeclarationprivate java.util.List<ResolvedType>exceptionTypesprivate java.util.List<ResolvedType>paramTypesprivate ResolvedTypereturnTypeprivate ResolvedTypeParametersMaptypeParametersMap
-
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)privateMethodUsage(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 ResolvedReferenceTypeDeclarationdeclaringType()java.util.List<ResolvedType>exceptionTypes()ResolvedMethodDeclarationgetDeclaration()java.lang.StringgetErasedSignature()The erased signature of the method.java.lang.StringgetName()intgetNoParams()Return the number of formal arguments accepted by this method.ResolvedTypegetParamType(int i)Return the type of the formal argument at the given position.java.util.List<ResolvedType>getParamTypes()java.lang.StringgetQualifiedSignature()The qualified signature of the method.java.lang.StringgetSignature()The signature of the method.booleanisReturnTypeSubstituable(MethodUsage otherMethodUsage)booleanisSameSignature(MethodUsage otherMethodUsage)booleanisSubSignature(MethodUsage otherMethodUsage)MethodUsagereplaceExceptionType(int i, ResolvedType replaced)MethodUsagereplaceParamType(int i, ResolvedType replaced)MethodUsagereplaceReturnType(ResolvedType returnType)MethodUsagereplaceTypeParameter(ResolvedTypeParameterDeclaration typeParameter, ResolvedType type)ResolvedTypereturnType()java.lang.StringtoString()ResolvedTypeParametersMaptypeParametersMap()
-
-
-
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:
toStringin 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:
typeParametersMapin 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.
-
getErasedSignature
public java.lang.String getErasedSignature()
The erased signature of the method.
-
exceptionTypes
public java.util.List<ResolvedType> exceptionTypes()
-
isSameSignature
public boolean isSameSignature(MethodUsage otherMethodUsage)
-
isSubSignature
public boolean isSubSignature(MethodUsage otherMethodUsage)
-
isReturnTypeSubstituable
public boolean isReturnTypeSubstituable(MethodUsage otherMethodUsage)
-
-