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 Node
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SimpleNameprivate ReceiverParameterprivate NodeList<ReferenceType> private NodeList<TypeParameter> Fields inherited from class 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(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, ReceiverParameter receiverParameter) 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 Summary
Modifier and TypeMethodDescriptionprotected StringappendThrowsIfRequested(boolean includingThrows) clone()Return the modifiers of this member declaration.getName()private TypevoidbooleanbooleanbooleanbooleanbooleansetModifiers(NodeList<Modifier> modifiers) setName(SimpleName name) setParameters(NodeList<Parameter> parameters) setReceiverParameter(ReceiverParameter receiverParameter) setThrownExceptions(NodeList<ReferenceType> thrownExceptions) setTypeParameters(NodeList<TypeParameter> typeParameters) private TypestripAnnotations(Type type) private TypestripGenerics(Type type) Methods inherited from class 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 Node
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findByRange, findCompilationUnit, findData, 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 interface HasParentNode
findAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOfMethods inherited from interface NodeWithAbstractModifier
isAbstract, setAbstractMethods inherited from interface NodeWithAnnotations
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnitMethods inherited from interface NodeWithDeclaration
getDeclarationAsString, getDeclarationAsString, getDeclarationAsStringMethods inherited from interface NodeWithFinalModifier
isFinal, setFinalMethods inherited from interface NodeWithJavadoc
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment, setJavadocComment, setJavadocCommentMethods inherited from interface NodeWithModifiers
addModifier, getAccessSpecifier, hasModifier, removeModifier, setModifier, setModifiersMethods inherited from interface NodeWithParameters
addAndGetParameter, addAndGetParameter, addAndGetParameter, addAndGetParameter, addParameter, addParameter, addParameter, addParameter, getParameter, getParameterByName, getParameterByType, getParameterByType, hasParametersOfType, hasParametersOfType, setParameter, tryAddImportToParentCompilationUnitMethods inherited from interface NodeWithPrivateModifier
isPrivate, setPrivateMethods inherited from interface NodeWithProtectedModifier
isProtected, setProtectedMethods inherited from interface NodeWithPublicModifier
isPublic, setPublicMethods inherited from interface NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRangeMethods inherited from interface NodeWithSimpleName
getNameAsExpression, getNameAsString, setNameMethods inherited from interface NodeWithStaticModifier
isStatic, setStaticMethods inherited from interface NodeWithStrictfpModifier
isStrictfp, setStrictfpMethods inherited from interface NodeWithThrownExceptions
addThrownException, addThrownException, getThrownException, isThrown, isThrown, tryAddImportToParentCompilationUnitMethods inherited from interface NodeWithTypeParameters
addTypeParameter, addTypeParameter, getTypeParameter, isGeneric, setTypeParameter
-
Field Details
-
modifiers
-
typeParameters
-
name
-
parameters
-
thrownExceptions
-
receiverParameter
-
-
Constructor Details
-
CallableDeclaration
CallableDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, ReceiverParameter receiverParameter) -
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:
-
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
-
stripAnnotations
-
stripGenerics
-
getTypeWithVarargsAsArray
-
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()
-