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
Nested ClassesModifier and TypeClassDescriptionstatic classA 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
ConstructorsConstructorDescriptionCallableDeclaration(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 StringappendThrowsIfRequested(boolean includingThrows)clone()Return the modifiers of this member declaration.getName()voidifCallableDeclaration(Consumer<CallableDeclaration> action)booleanbooleanbooleanbooleanbooleansetModifiers(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, toTypeDeclarationMethods 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, walkMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, hasParentNode, isDescendantOfMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier
isAbstract, setAbstractMethods 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, tryAddImportToParentCompilationUnitMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithDeclaration
getDeclarationAsString, getDeclarationAsString, getDeclarationAsStringMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithFinalModifier
isFinal, setFinalMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithJavadoc
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment, setJavadocCommentMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithModifiers
addModifier, getAccessSpecifier, hasModifier, removeModifier, setModifier, setModifiersMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithParameters
addAndGetParameter, addAndGetParameter, addAndGetParameter, addAndGetParameter, addParameter, addParameter, addParameter, addParameter, getParameter, getParameterByName, getParameterByType, getParameterByType, hasParametersOfType, hasParametersOfType, setParameter, tryAddImportToParentCompilationUnitMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPrivateModifier
isPrivate, setPrivateMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithProtectedModifier
isProtected, setProtectedMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithPublicModifier
isPublic, setPublicMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRangeMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithSimpleName
getNameAsExpression, getNameAsString, setNameMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStaticModifier
isStatic, setStaticMethods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithStrictfpModifier
isStrictfp, setStrictfpMethods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithThrownExceptions
addThrownException, addThrownException, getThrownException, isThrown, isThrown, tryAddImportToParentCompilationUnitMethods 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:
getModifiersin interfaceNodeWithModifiers<T extends CallableDeclaration<?>>- Returns:
- modifiers
- See Also:
Modifier
-
setModifiers
- Specified by:
setModifiersin interfaceNodeWithModifiers<T extends CallableDeclaration<?>>
-
getName
- Specified by:
getNamein interfaceNodeWithSimpleName<T extends CallableDeclaration<?>>
-
setName
- Specified by:
setNamein interfaceNodeWithSimpleName<T extends CallableDeclaration<?>>
-
getParameters
- Specified by:
getParametersin interfaceNodeWithParameters<T extends CallableDeclaration<?>>
-
setParameters
- Specified by:
setParametersin interfaceNodeWithParameters<T extends CallableDeclaration<?>>
-
getThrownExceptions
- Specified by:
getThrownExceptionsin interfaceNodeWithThrownExceptions<T extends CallableDeclaration<?>>
-
setThrownExceptions
- Specified by:
setThrownExceptionsin interfaceNodeWithThrownExceptions<T extends CallableDeclaration<?>>
-
getTypeParameters
- Specified by:
getTypeParametersin interfaceNodeWithTypeParameters<T extends CallableDeclaration<?>>
-
setTypeParameters
- Specified by:
setTypeParametersin interfaceNodeWithTypeParameters<T extends CallableDeclaration<?>>
-
appendThrowsIfRequested
-
remove
- Overrides:
removein classBodyDeclaration<T extends CallableDeclaration<?>>
-
getSignature
-
clone
- Overrides:
clonein classBodyDeclaration<T extends CallableDeclaration<?>>
-
getMetaModel
- Overrides:
getMetaModelin classBodyDeclaration<T extends CallableDeclaration<?>>- Returns:
- get JavaParser specific node introspection information.
-
replace
- Overrides:
replacein classBodyDeclaration<T extends CallableDeclaration<?>>
-
isCallableDeclaration
public boolean isCallableDeclaration()- Overrides:
isCallableDeclarationin classBodyDeclaration<T extends CallableDeclaration<?>>
-
asCallableDeclaration
- Overrides:
asCallableDeclarationin classBodyDeclaration<T extends CallableDeclaration<?>>
-
ifCallableDeclaration
- Overrides:
ifCallableDeclarationin classBodyDeclaration<T extends CallableDeclaration<?>>
-
getReceiverParameter
-
setReceiverParameter
-
removeReceiverParameter
-
toCallableDeclaration
- Overrides:
toCallableDeclarationin classBodyDeclaration<T extends CallableDeclaration<?>>
-
isVariableArityMethod
public boolean isVariableArityMethod() -
isFixedArityMethod
public boolean isFixedArityMethod()
-