Class JavaParserMethodDeclaration
- java.lang.Object
-
- com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserMethodDeclaration
-
- All Implemented Interfaces:
AssociableToAST<MethodDeclaration>
,HasAccessSpecifier
,ResolvedDeclaration
,ResolvedMethodDeclaration
,ResolvedMethodLikeDeclaration
,ResolvedTypeParametrizable
,TypeVariableResolutionCapability
public class JavaParserMethodDeclaration extends Object implements ResolvedMethodDeclaration, TypeVariableResolutionCapability
- Author:
- Federico Tomassetti
-
-
Constructor Summary
Constructors Constructor Description JavaParserMethodDeclaration(MethodDeclaration wrappedNode, TypeSolver typeSolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessSpecifier
accessSpecifier()
ResolvedReferenceTypeDeclaration
declaringType()
String
getName()
int
getNumberOfParams()
int
getNumberOfSpecifiedExceptions()
ResolvedParameterDeclaration
getParam(int i)
ResolvedType
getReturnType()
ResolvedType
getSpecifiedException(int index)
List<ResolvedTypeParameterDeclaration>
getTypeParameters()
MethodUsage
getUsage(Node node)
MethodDeclaration
getWrappedNode()
Returns the JavaParser node associated with this JavaParserMethodDeclaration.boolean
isAbstract()
boolean
isDefaultMethod()
boolean
isField()
boolean
isParameter()
boolean
isStatic()
boolean
isType()
MethodUsage
resolveTypeVariables(Context context, List<ResolvedType> parameterTypes)
Optional<MethodDeclaration>
toAst()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asType, hasName, isEnumConstant, isMethod, isVariable
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
findTypeParameter, getClassName, getLastParam, getPackageName, getQualifiedName, getQualifiedSignature, getSignature, getSpecifiedExceptions, hasVariadicParameter
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
-
-
-
Constructor Detail
-
JavaParserMethodDeclaration
public JavaParserMethodDeclaration(MethodDeclaration wrappedNode, TypeSolver typeSolver)
-
-
Method Detail
-
declaringType
public ResolvedReferenceTypeDeclaration declaringType()
- Specified by:
declaringType
in interfaceResolvedMethodLikeDeclaration
-
getReturnType
public ResolvedType getReturnType()
- Specified by:
getReturnType
in interfaceResolvedMethodDeclaration
-
getNumberOfParams
public int getNumberOfParams()
- Specified by:
getNumberOfParams
in interfaceResolvedMethodLikeDeclaration
-
getParam
public ResolvedParameterDeclaration getParam(int i)
- Specified by:
getParam
in interfaceResolvedMethodLikeDeclaration
-
getUsage
public MethodUsage getUsage(Node node)
-
resolveTypeVariables
public MethodUsage resolveTypeVariables(Context context, List<ResolvedType> parameterTypes)
- Specified by:
resolveTypeVariables
in interfaceTypeVariableResolutionCapability
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceResolvedMethodDeclaration
-
getName
public String getName()
- Specified by:
getName
in interfaceResolvedDeclaration
-
isField
public boolean isField()
- Specified by:
isField
in interfaceResolvedDeclaration
-
isParameter
public boolean isParameter()
- Specified by:
isParameter
in interfaceResolvedDeclaration
-
isType
public boolean isType()
- Specified by:
isType
in interfaceResolvedDeclaration
-
getTypeParameters
public List<ResolvedTypeParameterDeclaration> getTypeParameters()
- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
isDefaultMethod
public boolean isDefaultMethod()
- Specified by:
isDefaultMethod
in interfaceResolvedMethodDeclaration
-
isStatic
public boolean isStatic()
- Specified by:
isStatic
in interfaceResolvedMethodDeclaration
-
getWrappedNode
public MethodDeclaration getWrappedNode()
Returns the JavaParser node associated with this JavaParserMethodDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
accessSpecifier
public AccessSpecifier accessSpecifier()
- Specified by:
accessSpecifier
in interfaceHasAccessSpecifier
-
getNumberOfSpecifiedExceptions
public int getNumberOfSpecifiedExceptions()
- Specified by:
getNumberOfSpecifiedExceptions
in interfaceResolvedMethodLikeDeclaration
-
getSpecifiedException
public ResolvedType getSpecifiedException(int index)
- Specified by:
getSpecifiedException
in interfaceResolvedMethodLikeDeclaration
-
toAst
public Optional<MethodDeclaration> toAst()
- Specified by:
toAst
in interfaceAssociableToAST<MethodDeclaration>
-
-