Class JavaParserMethodDeclaration
- java.lang.Object
-
- com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserMethodDeclaration
-
- All Implemented Interfaces:
com.github.javaparser.resolution.declarations.AssociableToAST<com.github.javaparser.ast.body.MethodDeclaration>
,com.github.javaparser.resolution.declarations.HasAccessSpecifier
,com.github.javaparser.resolution.declarations.ResolvedDeclaration
,com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration
,com.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
,com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
public class JavaParserMethodDeclaration extends Object implements com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration
- Author:
- Federico Tomassetti
-
-
Constructor Summary
Constructors Constructor Description JavaParserMethodDeclaration(com.github.javaparser.ast.body.MethodDeclaration wrappedNode, com.github.javaparser.symbolsolver.model.resolution.TypeSolver typeSolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.github.javaparser.ast.AccessSpecifier
accessSpecifier()
com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
declaringType()
String
getName()
int
getNumberOfParams()
int
getNumberOfSpecifiedExceptions()
com.github.javaparser.resolution.declarations.ResolvedParameterDeclaration
getParam(int i)
com.github.javaparser.resolution.types.ResolvedType
getReturnType()
com.github.javaparser.resolution.types.ResolvedType
getSpecifiedException(int index)
List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration>
getTypeParameters()
com.github.javaparser.resolution.MethodUsage
getUsage(com.github.javaparser.ast.Node node)
com.github.javaparser.ast.body.MethodDeclaration
getWrappedNode()
Returns the JavaParser node associated with this JavaParserMethodDeclaration.boolean
isAbstract()
boolean
isDefaultMethod()
boolean
isField()
boolean
isParameter()
boolean
isStatic()
boolean
isType()
com.github.javaparser.resolution.MethodUsage
resolveTypeVariables(Context context, List<com.github.javaparser.resolution.types.ResolvedType> parameterTypes)
Optional<com.github.javaparser.ast.body.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
-
-
-
-
Method Detail
-
declaringType
public com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration declaringType()
- Specified by:
declaringType
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
-
getReturnType
public com.github.javaparser.resolution.types.ResolvedType getReturnType()
- Specified by:
getReturnType
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodDeclaration
-
getNumberOfParams
public int getNumberOfParams()
- Specified by:
getNumberOfParams
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
-
getParam
public com.github.javaparser.resolution.declarations.ResolvedParameterDeclaration getParam(int i)
- Specified by:
getParam
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
-
getUsage
public com.github.javaparser.resolution.MethodUsage getUsage(com.github.javaparser.ast.Node node)
-
resolveTypeVariables
public com.github.javaparser.resolution.MethodUsage resolveTypeVariables(Context context, List<com.github.javaparser.resolution.types.ResolvedType> parameterTypes)
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodDeclaration
-
getName
public String getName()
- Specified by:
getName
in interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
isField
public boolean isField()
- Specified by:
isField
in interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
isParameter
public boolean isParameter()
- Specified by:
isParameter
in interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
isType
public boolean isType()
- Specified by:
isType
in interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
getTypeParameters
public List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration> getTypeParameters()
- Specified by:
getTypeParameters
in interfacecom.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
-
isDefaultMethod
public boolean isDefaultMethod()
- Specified by:
isDefaultMethod
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodDeclaration
-
isStatic
public boolean isStatic()
- Specified by:
isStatic
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodDeclaration
-
getWrappedNode
public com.github.javaparser.ast.body.MethodDeclaration getWrappedNode()
Returns the JavaParser node associated with this JavaParserMethodDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
accessSpecifier
public com.github.javaparser.ast.AccessSpecifier accessSpecifier()
- Specified by:
accessSpecifier
in interfacecom.github.javaparser.resolution.declarations.HasAccessSpecifier
-
getNumberOfSpecifiedExceptions
public int getNumberOfSpecifiedExceptions()
- Specified by:
getNumberOfSpecifiedExceptions
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
-
getSpecifiedException
public com.github.javaparser.resolution.types.ResolvedType getSpecifiedException(int index)
- Specified by:
getSpecifiedException
in interfacecom.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration
-
toAst
public Optional<com.github.javaparser.ast.body.MethodDeclaration> toAst()
- Specified by:
toAst
in interfacecom.github.javaparser.resolution.declarations.AssociableToAST<com.github.javaparser.ast.body.MethodDeclaration>
-
-