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 AccessSpecifieraccessSpecifier()ResolvedReferenceTypeDeclarationdeclaringType()StringgetName()intgetNumberOfParams()intgetNumberOfSpecifiedExceptions()ResolvedParameterDeclarationgetParam(int i)ResolvedTypegetReturnType()ResolvedTypegetSpecifiedException(int index)List<ResolvedTypeParameterDeclaration>getTypeParameters()MethodUsagegetUsage(Node node)MethodDeclarationgetWrappedNode()Returns the JavaParser node associated with this JavaParserMethodDeclaration.booleanisAbstract()booleanisDefaultMethod()booleanisField()booleanisParameter()booleanisStatic()booleanisType()MethodUsageresolveTypeVariables(Context context, List<ResolvedType> parameterTypes)Optional<MethodDeclaration>toAst()StringtoString()-
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:
declaringTypein interfaceResolvedMethodLikeDeclaration
-
getReturnType
public ResolvedType getReturnType()
- Specified by:
getReturnTypein interfaceResolvedMethodDeclaration
-
getNumberOfParams
public int getNumberOfParams()
- Specified by:
getNumberOfParamsin interfaceResolvedMethodLikeDeclaration
-
getParam
public ResolvedParameterDeclaration getParam(int i)
- Specified by:
getParamin interfaceResolvedMethodLikeDeclaration
-
getUsage
public MethodUsage getUsage(Node node)
-
resolveTypeVariables
public MethodUsage resolveTypeVariables(Context context, List<ResolvedType> parameterTypes)
- Specified by:
resolveTypeVariablesin interfaceTypeVariableResolutionCapability
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceResolvedMethodDeclaration
-
getName
public String getName()
- Specified by:
getNamein interfaceResolvedDeclaration
-
isField
public boolean isField()
- Specified by:
isFieldin interfaceResolvedDeclaration
-
isParameter
public boolean isParameter()
- Specified by:
isParameterin interfaceResolvedDeclaration
-
isType
public boolean isType()
- Specified by:
isTypein interfaceResolvedDeclaration
-
getTypeParameters
public List<ResolvedTypeParameterDeclaration> getTypeParameters()
- Specified by:
getTypeParametersin interfaceResolvedTypeParametrizable
-
isDefaultMethod
public boolean isDefaultMethod()
- Specified by:
isDefaultMethodin interfaceResolvedMethodDeclaration
-
isStatic
public boolean isStatic()
- Specified by:
isStaticin 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:
accessSpecifierin interfaceHasAccessSpecifier
-
getNumberOfSpecifiedExceptions
public int getNumberOfSpecifiedExceptions()
- Specified by:
getNumberOfSpecifiedExceptionsin interfaceResolvedMethodLikeDeclaration
-
getSpecifiedException
public ResolvedType getSpecifiedException(int index)
- Specified by:
getSpecifiedExceptionin interfaceResolvedMethodLikeDeclaration
-
toAst
public Optional<MethodDeclaration> toAst()
- Specified by:
toAstin interfaceAssociableToAST<MethodDeclaration>
-
-