Package com.github.javaparser.ast.body
Class CallableDeclaration<T extends CallableDeclaration<?>>
java.lang.Object
com.github.javaparser.ast.Node
com.github.javaparser.ast.body.BodyDeclaration<T>
com.github.javaparser.ast.body.CallableDeclaration<T>
- All Implemented Interfaces:
NodeWithAbstractModifier<T>
,NodeWithAccessModifiers<T>
,NodeWithFinalModifier<T>
,NodeWithPrivateModifier<T>
,NodeWithProtectedModifier<T>
,NodeWithPublicModifier<T>
,NodeWithStaticModifier<T>
,NodeWithStrictfpModifier<T>
,NodeWithAnnotations<T>
,NodeWithDeclaration
,NodeWithJavadoc<T>
,NodeWithModifiers<T>
,NodeWithParameters<T>
,NodeWithRange<Node>
,NodeWithSimpleName<T>
,NodeWithThrownExceptions<T>
,NodeWithTokenRange<Node>
,NodeWithTypeParameters<T>
,Observable
,Visitable
,HasParentNode<Node>
,Cloneable
- Direct Known Subclasses:
ConstructorDeclaration
,MethodDeclaration
public abstract class CallableDeclaration<T extends CallableDeclaration<?>>
extends BodyDeclaration<T>
implements NodeWithAccessModifiers<T>, NodeWithDeclaration, NodeWithSimpleName<T>, NodeWithParameters<T>, NodeWithThrownExceptions<T>, NodeWithTypeParameters<T>, NodeWithJavadoc<T>, NodeWithAbstractModifier<T>, NodeWithStaticModifier<T>, NodeWithFinalModifier<T>, NodeWithStrictfpModifier<T>
Represents a declaration which is callable eg. a method or a constructor.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A method or constructor signature.Nested classes/interfaces inherited from class com.github.javaparser.ast.Node
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
-
Field Summary
Fields inherited from class com.github.javaparser.ast.Node
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY
-
Constructor Summary
ConstructorDescriptionCallableDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, ReceiverParameter receiverParameter)
This constructor is used by the parser and is considered private. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
appendThrowsIfRequested(boolean includingThrows)
clone()
Return the modifiers of this member declaration.getName()
void
ifCallableDeclaration(Consumer<CallableDeclaration> action)
boolean
boolean
boolean
boolean
boolean
setModifiers(NodeList<Modifier> modifiers)
setName(SimpleName name)
setParameters(NodeList<Parameter> parameters)
setReceiverParameter(ReceiverParameter receiverParameter)
setThrownExceptions(NodeList<ReferenceType> thrownExceptions)
setTypeParameters(NodeList<TypeParameter> typeParameters)
Methods inherited from class com.github.javaparser.ast.body.BodyDeclaration
asAnnotationDeclaration, asAnnotationMemberDeclaration, asClassOrInterfaceDeclaration, asCompactConstructorDeclaration, asConstructorDeclaration, asEnumConstantDeclaration, asEnumDeclaration, asFieldDeclaration, asInitializerDeclaration, asMethodDeclaration, asRecordDeclaration, asTypeDeclaration, getAnnotations, ifAnnotationDeclaration, ifAnnotationMemberDeclaration, ifClassOrInterfaceDeclaration, ifCompactConstructorDeclaration, ifConstructorDeclaration, ifEnumConstantDeclaration, ifEnumDeclaration, ifFieldDeclaration, ifInitializerDeclaration, ifMethodDeclaration, ifRecordDeclaration, ifTypeDeclaration, isAnnotationDeclaration, isAnnotationMemberDeclaration, isClassOrInterfaceDeclaration, isCompactConstructorDeclaration, isConstructorDeclaration, isEnumConstantDeclaration, isEnumDeclaration, isFieldDeclaration, isInitializerDeclaration, isMethodDeclaration, isRecordDeclaration, isTypeDeclaration, setAnnotations, toAnnotationDeclaration, toAnnotationMemberDeclaration, toClassOrInterfaceDeclaration, toCompactConstructorDeclaration, toConstructorDeclaration, toEnumConstantDeclaration, toEnumDeclaration, toFieldDeclaration, toInitializerDeclaration, toMethodDeclaration, toRecordDeclaration, toTypeDeclaration
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOf
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier
isAbstract, setAbstract
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithAnnotations
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithDeclaration
getDeclarationAsString, getDeclarationAsString, getDeclarationAsString
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithFinalModifier
isFinal, setFinal
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithJavadoc
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment, setJavadocComment
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithModifiers
addModifier, getAccessSpecifier, hasModifier, removeModifier, setModifier, setModifiers
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithParameters
addAndGetParameter, addAndGetParameter, addAndGetParameter, addAndGetParameter, addParameter, addParameter, addParameter, addParameter, getParameter, getParameterByName, getParameterByType, getParameterByType, hasParametersOfType, hasParametersOfType, setParameter, tryAddImportToParentCompilationUnit
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPrivateModifier
isPrivate, setPrivate
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithProtectedModifier
isProtected, setProtected
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPublicModifier
isPublic, setPublic
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithSimpleName
getNameAsExpression, getNameAsString, setName
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStaticModifier
isStatic, setStatic
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStrictfpModifier
isStrictfp, setStrictfp
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithThrownExceptions
addThrownException, addThrownException, getThrownException, isThrown, isThrown, tryAddImportToParentCompilationUnit
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithTypeParameters
addTypeParameter, addTypeParameter, getTypeParameter, isGeneric, setTypeParameter
-
Constructor Details
-
CallableDeclaration
public CallableDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, ReceiverParameter receiverParameter)This constructor is used by the parser and is considered private.
-
-
Method Details
-
getModifiers
Return the modifiers of this member declaration.- Specified by:
getModifiers
in interfaceNodeWithModifiers<T extends CallableDeclaration<?>>
- Returns:
- modifiers
- See Also:
Modifier
-
setModifiers
- Specified by:
setModifiers
in interfaceNodeWithModifiers<T extends CallableDeclaration<?>>
-
getName
- Specified by:
getName
in interfaceNodeWithSimpleName<T extends CallableDeclaration<?>>
-
setName
- Specified by:
setName
in interfaceNodeWithSimpleName<T extends CallableDeclaration<?>>
-
getParameters
- Specified by:
getParameters
in interfaceNodeWithParameters<T extends CallableDeclaration<?>>
-
setParameters
- Specified by:
setParameters
in interfaceNodeWithParameters<T extends CallableDeclaration<?>>
-
getThrownExceptions
- Specified by:
getThrownExceptions
in interfaceNodeWithThrownExceptions<T extends CallableDeclaration<?>>
-
setThrownExceptions
- Specified by:
setThrownExceptions
in interfaceNodeWithThrownExceptions<T extends CallableDeclaration<?>>
-
getTypeParameters
- Specified by:
getTypeParameters
in interfaceNodeWithTypeParameters<T extends CallableDeclaration<?>>
-
setTypeParameters
- Specified by:
setTypeParameters
in interfaceNodeWithTypeParameters<T extends CallableDeclaration<?>>
-
appendThrowsIfRequested
-
remove
- Overrides:
remove
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
getSignature
-
clone
- Overrides:
clone
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
getMetaModel
- Overrides:
getMetaModel
in classBodyDeclaration<T extends CallableDeclaration<?>>
- Returns:
- get JavaParser specific node introspection information.
-
replace
- Overrides:
replace
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
isCallableDeclaration
public boolean isCallableDeclaration()- Overrides:
isCallableDeclaration
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
asCallableDeclaration
- Overrides:
asCallableDeclaration
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
ifCallableDeclaration
- Overrides:
ifCallableDeclaration
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
getReceiverParameter
-
setReceiverParameter
-
removeReceiverParameter
-
toCallableDeclaration
- Overrides:
toCallableDeclaration
in classBodyDeclaration<T extends CallableDeclaration<?>>
-
isVariableArityMethod
public boolean isVariableArityMethod() -
isFixedArityMethod
public boolean isFixedArityMethod()
-