public final class MethodDeclaration extends BodyDeclaration implements DocumentableNode, WithDeclaration, NamedNode
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE
Constructor and Description |
---|
MethodDeclaration() |
MethodDeclaration(int beginLine,
int beginColumn,
int endLine,
int endColumn,
int modifiers,
List<AnnotationExpr> annotations,
List<TypeParameter> typeParameters,
Type type,
String name,
List<Parameter> parameters,
int arrayCount,
List<NameExpr> throws_,
BlockStmt block) |
MethodDeclaration(int modifiers,
List<AnnotationExpr> annotations,
List<TypeParameter> typeParameters,
Type type,
String name,
List<Parameter> parameters,
int arrayCount,
List<NameExpr> throws_,
BlockStmt block) |
MethodDeclaration(int modifiers,
Type type,
String name) |
MethodDeclaration(int modifiers,
Type type,
String name,
List<Parameter> parameters) |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
int |
getArrayCount() |
BlockStmt |
getBody() |
String |
getDeclarationAsString()
As
WithDeclaration.getDeclarationAsString(boolean, boolean, boolean) including
the modifiers, the throws clause and the parameters with both type and name. |
String |
getDeclarationAsString(boolean includingModifiers,
boolean includingThrows)
As
WithDeclaration.getDeclarationAsString(boolean, boolean, boolean) including
the parameters with both type and name. |
String |
getDeclarationAsString(boolean includingModifiers,
boolean includingThrows,
boolean includingParameterName)
The declaration returned has this schema:
[accessSpecifier] [static] [abstract] [final] [native]
[synchronized] returnType methodName ([paramType [paramName]])
[throws exceptionsList]
|
JavadocComment |
getJavaDoc() |
int |
getModifiers()
Return the modifiers of this member declaration.
|
String |
getName() |
NameExpr |
getNameExpr() |
List<Parameter> |
getParameters() |
List<NameExpr> |
getThrows() |
Type |
getType() |
List<TypeParameter> |
getTypeParameters() |
boolean |
isDefault() |
void |
setArrayCount(int arrayCount) |
void |
setBody(BlockStmt body) |
void |
setDefault(boolean isDefault) |
void |
setJavaDoc(JavadocComment javadocComment) |
void |
setModifiers(int modifiers) |
void |
setName(String name) |
void |
setNameExpr(NameExpr name) |
void |
setParameters(List<Parameter> parameters) |
void |
setThrows(List<NameExpr> throws_) |
void |
setType(Type type) |
void |
setTypeParameters(List<TypeParameter> typeParameters) |
getAnnotations, setAnnotations
addOrphanComment, contains, equals, getAllContainedComments, getBeginColumn, getBeginLine, getChildrenNodes, getComment, getData, getEndColumn, getEndLine, getOrphanComments, getParentNode, hasComment, hashCode, isPositionedAfter, isPositionedBefore, setAsParentNodeOf, setAsParentNodeOf, setBeginColumn, setBeginLine, setComment, setData, setEndColumn, setEndLine, setParentNode, toString, toStringWithoutComments
public MethodDeclaration()
public MethodDeclaration(int modifiers, Type type, String name, List<Parameter> parameters)
public MethodDeclaration(int modifiers, List<AnnotationExpr> annotations, List<TypeParameter> typeParameters, Type type, String name, List<Parameter> parameters, int arrayCount, List<NameExpr> throws_, BlockStmt block)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Node
public <A> void accept(VoidVisitor<A> v, A arg)
Node
public int getArrayCount()
public BlockStmt getBody()
public int getModifiers()
ModifierSet
public NameExpr getNameExpr()
public Type getType()
public List<TypeParameter> getTypeParameters()
public void setArrayCount(int arrayCount)
public void setBody(BlockStmt body)
public void setModifiers(int modifiers)
public void setName(String name)
public void setNameExpr(NameExpr name)
public void setType(Type type)
public void setTypeParameters(List<TypeParameter> typeParameters)
public boolean isDefault()
public void setDefault(boolean isDefault)
public String getDeclarationAsString()
WithDeclaration
WithDeclaration.getDeclarationAsString(boolean, boolean, boolean)
including
the modifiers, the throws clause and the parameters with both type and name.getDeclarationAsString
in interface WithDeclaration
public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows)
WithDeclaration
WithDeclaration.getDeclarationAsString(boolean, boolean, boolean)
including
the parameters with both type and name.getDeclarationAsString
in interface WithDeclaration
includingModifiers
- flag to include the modifiers (if present) in the string producedincludingThrows
- flag to include the throws clause (if present) in the string producedpublic String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName)
getDeclarationAsString
in interface WithDeclaration
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 producedpublic void setJavaDoc(JavadocComment javadocComment)
setJavaDoc
in interface DocumentableNode
public JavadocComment getJavaDoc()
getJavaDoc
in interface DocumentableNode
Copyright © 2007-2015. All Rights Reserved.