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>
Modifier and Type | Class and Description |
---|---|
static class |
CallableDeclaration.Signature
A method or constructor signature.
|
Node.ObserverRegistrationMode, Node.Parsedness
Modifier and Type | Field and Description |
---|---|
private java.util.EnumSet<Modifier> |
modifiers |
private SimpleName |
name |
private NodeList<Parameter> |
parameters |
private NodeList<ReferenceType> |
thrownExceptions |
private NodeList<TypeParameter> |
typeParameters |
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
CallableDeclaration(java.util.EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<TypeParameter> typeParameters,
SimpleName name,
NodeList<Parameter> parameters,
NodeList<ReferenceType> thrownExceptions) |
CallableDeclaration(TokenRange tokenRange,
java.util.EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<TypeParameter> typeParameters,
SimpleName name,
NodeList<Parameter> parameters,
NodeList<ReferenceType> thrownExceptions)
This constructor is used by the parser and is considered private.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
appendThrowsIfRequested(boolean includingThrows) |
CallableDeclaration<?> |
clone() |
java.lang.String |
getDeclarationAsString()
As
NodeWithDeclaration.getDeclarationAsString(boolean, boolean, boolean) including
the modifiers, the throws clause and the parameters with both type and name. |
java.lang.String |
getDeclarationAsString(boolean includingModifiers,
boolean includingThrows)
As
NodeWithDeclaration.getDeclarationAsString(boolean, boolean, boolean) including
the parameters with both type and name. |
abstract java.lang.String |
getDeclarationAsString(boolean includingModifiers,
boolean includingThrows,
boolean includingParameterName)
A simple representation of the element declaration.
|
CallableDeclarationMetaModel |
getMetaModel() |
java.util.EnumSet<Modifier> |
getModifiers()
Return the modifiers of this member declaration.
|
SimpleName |
getName() |
java.util.List<NodeList<?>> |
getNodeLists()
The list of NodeLists owned by this node.
|
NodeList<Parameter> |
getParameters() |
CallableDeclaration.Signature |
getSignature() |
NodeList<ReferenceType> |
getThrownExceptions() |
NodeList<TypeParameter> |
getTypeParameters() |
private Type |
getTypeWithVarargsAsArray(Parameter p) |
boolean |
remove(Node node) |
boolean |
replace(Node node,
Node replacementNode) |
T |
setModifiers(java.util.EnumSet<Modifier> modifiers) |
T |
setName(SimpleName name) |
T |
setParameters(NodeList<Parameter> parameters) |
T |
setThrownExceptions(NodeList<ReferenceType> thrownExceptions) |
T |
setTypeParameters(NodeList<TypeParameter> typeParameters) |
private Type |
stripAnnotations(Type type) |
private Type |
stripGenerics(Type type) |
getAnnotations, setAnnotations
addOrphanComment, customInitialization, equals, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
isPublic, setPublic
isPrivate, setPrivate
isProtected, setProtected
addModifier, removeModifier, setModifier
getNameAsString, setName
addAndGetParameter, addAndGetParameter, addAndGetParameter, addAndGetParameter, addParameter, addParameter, addParameter, addParameter, getParameter, getParameterByName, getParameterByType, getParameterByType, hasParametersOfType, hasParametersOfType, setParameter, tryAddImportToParentCompilationUnit
addThrownException, addThrownException, getThrownException, isThrown, isThrown, tryAddImportToParentCompilationUnit
addTypeParameter, getTypeParameter, isGeneric, setTypeParameter
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment
isAbstract, setAbstract
isStatic, setStatic
isFinal, setFinal
isStrictfp, setStrictfp
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
private java.util.EnumSet<Modifier> modifiers
private NodeList<TypeParameter> typeParameters
private SimpleName name
private NodeList<ReferenceType> thrownExceptions
public CallableDeclaration(java.util.EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions)
@Generated(value="com.github.javaparser.generator.core.node.MainConstructorGenerator") public CallableDeclaration(TokenRange tokenRange, java.util.EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions)
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public java.util.EnumSet<Modifier> getModifiers()
getModifiers
in interface NodeWithModifiers<T extends CallableDeclaration<?>>
Modifier
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public T setModifiers(java.util.EnumSet<Modifier> modifiers)
setModifiers
in interface NodeWithModifiers<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public SimpleName getName()
getName
in interface NodeWithSimpleName<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public T setName(SimpleName name)
setName
in interface NodeWithSimpleName<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<Parameter> getParameters()
getParameters
in interface NodeWithParameters<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public T setParameters(NodeList<Parameter> parameters)
setParameters
in interface NodeWithParameters<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<ReferenceType> getThrownExceptions()
getThrownExceptions
in interface NodeWithThrownExceptions<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public T setThrownExceptions(NodeList<ReferenceType> thrownExceptions)
setThrownExceptions
in interface NodeWithThrownExceptions<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<TypeParameter> getTypeParameters()
getTypeParameters
in interface NodeWithTypeParameters<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public T setTypeParameters(NodeList<TypeParameter> typeParameters)
setTypeParameters
in interface NodeWithTypeParameters<T extends CallableDeclaration<?>>
public java.lang.String getDeclarationAsString(boolean includingModifiers, boolean includingThrows)
NodeWithDeclaration
NodeWithDeclaration.getDeclarationAsString(boolean, boolean, boolean)
including
the parameters with both type and name.getDeclarationAsString
in interface NodeWithDeclaration
includingModifiers
- flag to include the modifiers (if present) in the string producedincludingThrows
- flag to include the throws clause (if present) in the string producedpublic java.lang.String getDeclarationAsString()
NodeWithDeclaration
NodeWithDeclaration.getDeclarationAsString(boolean, boolean, boolean)
including
the modifiers, the throws clause and the parameters with both type and name.getDeclarationAsString
in interface NodeWithDeclaration
public abstract java.lang.String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName)
NodeWithDeclaration
getDeclarationAsString
in interface NodeWithDeclaration
includingModifiers
- flag to include the modifiers (if present) in the string producedincludingThrows
- flag to include the throws clause (if present) in the string producedincludingParameterName
- flag to include the parameter name (while the parameter type is always included) in
the string producedprotected java.lang.String appendThrowsIfRequested(boolean includingThrows)
public java.util.List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class BodyDeclaration<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove
in class BodyDeclaration<T extends CallableDeclaration<?>>
public CallableDeclaration.Signature getSignature()
@Generated(value="com.github.javaparser.generator.core.node.CloneGenerator") public CallableDeclaration<?> clone()
clone
in class BodyDeclaration<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.GetMetaModelGenerator") public CallableDeclarationMetaModel getMetaModel()
getMetaModel
in class BodyDeclaration<T extends CallableDeclaration<?>>
@Generated(value="com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace
in class BodyDeclaration<T extends CallableDeclaration<?>>