class X { public int abc() {return 1;}
}
All annotations preceding the return type will be set on this object, not on the return type.
JavaParser doesn't know if it they are applicable to the method or the type.
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | MethodDeclaration(final NodeList<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body)
|
| public | MethodDeclaration(final NodeList<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body, ReceiverParameter receiverParameter)
|
| public | MethodDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type type, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter)
This constructor is used by the parser and is considered private. |
| body | back to summary |
|---|---|
| private BlockStmt body
| |
| type | back to summary |
|---|---|
| private Type type | |
| MethodDeclaration | back to summary |
|---|---|
| public MethodDeclaration() | |
| MethodDeclaration | back to summary |
|---|---|
| public MethodDeclaration(final NodeList<Modifier> modifiers, final Type type, final String name) | |
| MethodDeclaration | back to summary |
|---|---|
| public MethodDeclaration(final NodeList<Modifier> modifiers, final String name, final Type type, final NodeList<Parameter> parameters) | |
| MethodDeclaration | back to summary |
|---|---|
| public MethodDeclaration(final NodeList<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body) | |
| MethodDeclaration | back to summary |
|---|---|
public MethodDeclaration(final NodeList<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body, ReceiverParameter receiverParameter)
| |
| MethodDeclaration | back to summary |
|---|---|
| public MethodDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, Type type, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter) This constructor is used by the parser and is considered private.
| |
| accept | back to summary |
|---|---|
| public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| accept | back to summary |
|---|---|
| public <A> void accept(final VoidVisitor<A> v, final A arg) Implements com. Doc from com. Accept method for visitor support.
| |
| asMethodDeclaration | back to summary |
|---|---|
| public MethodDeclaration asMethodDeclaration() Overrides com.
| |
| clone | back to summary |
|---|---|
| public MethodDeclaration clone() Overrides com. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| getBody | back to summary |
|---|---|
| public Optional Implements com.
| |
| getDeclarationAsString | back to summary |
|---|---|
| public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) Implements com. The declaration returned has this schema: [accessSpecifier] [static] [abstract] [final] [native] [synchronized] returnType methodName ([paramType [paramName]]) [throws exceptionsList]
| |
| getMetaModel | back to summary |
|---|---|
| public MethodDeclarationMetaModel getMetaModel() Overrides com.
| |
| getType | back to summary |
|---|---|
| public Type getType() Implements com. Doc from com. Gets the type
| |
| ifMethodDeclaration | back to summary |
|---|---|
| public void ifMethodDeclaration(Consumer<MethodDeclaration> action) Overrides com.
| |
| isDefault | back to summary |
|---|---|
| public boolean isDefault() | |
| isMethodDeclaration | back to summary |
|---|---|
| public boolean isMethodDeclaration() Overrides com.
| |
| isNative | back to summary |
|---|---|
| public boolean isNative() | |
| isSynchronized | back to summary |
|---|---|
| public boolean isSynchronized() | |
| remove | back to summary |
|---|---|
| public boolean remove(Node node) Overrides com.
| |
| removeBody | back to summary |
|---|---|
| public MethodDeclaration removeBody() Implements com.
| |
| replace | back to summary |
|---|---|
| public boolean replace(Node node, Node replacementNode) Overrides com.
| |
| resolve | back to summary |
|---|---|
| public ResolvedMethodDeclaration resolve() Implements com.
| |
| setBody | back to summary |
|---|---|
| public MethodDeclaration setBody(final BlockStmt body) Implements com. Sets the body
| |
| setDefault | back to summary |
|---|---|
| public MethodDeclaration setDefault(boolean set) | |
| setModifiers | back to summary |
|---|---|
| public MethodDeclaration setModifiers(final NodeList<Modifier> modifiers) Overrides com. Implements com.
| |
| setName | back to summary |
|---|---|
| public MethodDeclaration setName(final SimpleName name) Overrides com. Implements com.
| |
| setNative | back to summary |
|---|---|
| public MethodDeclaration setNative(boolean set) | |
| setParameters | back to summary |
|---|---|
| public MethodDeclaration setParameters(final NodeList<Parameter> parameters) Overrides com. Implements com.
| |
| setSynchronized | back to summary |
|---|---|
| public MethodDeclaration setSynchronized(boolean set) | |
| setThrownExceptions | back to summary |
|---|---|
| public MethodDeclaration setThrownExceptions(final NodeList<ReferenceType> thrownExceptions) Overrides com. Implements com.
| |
| setType | back to summary |
|---|---|
| public MethodDeclaration setType(final Type type) Implements com. Doc from com. Sets the type
| |
| setTypeParameters | back to summary |
|---|---|
| public MethodDeclaration setTypeParameters(final NodeList<TypeParameter> typeParameters) Overrides com. Implements com.
| |
| toMethodDeclaration | back to summary |
|---|---|
| public Optional Overrides com.
| |