public final class MethodDeclaration extends BodyDeclaration implements DocumentableNode, WithDeclaration
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE| Constructor and Description |
|---|
MethodDeclaration() |
MethodDeclaration(int beginLine,
int beginColumn,
int endLine,
int endColumn,
int modifiers,
java.util.List<AnnotationExpr> annotations,
java.util.List<TypeParameter> typeParameters,
Type type,
java.lang.String name,
java.util.List<Parameter> parameters,
int arrayCount,
java.util.List<NameExpr> throws_,
BlockStmt block) |
MethodDeclaration(int modifiers,
java.util.List<AnnotationExpr> annotations,
java.util.List<TypeParameter> typeParameters,
Type type,
java.lang.String name,
java.util.List<Parameter> parameters,
int arrayCount,
java.util.List<NameExpr> throws_,
BlockStmt block) |
MethodDeclaration(int modifiers,
Type type,
java.lang.String name) |
MethodDeclaration(int modifiers,
Type type,
java.lang.String name,
java.util.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() |
java.lang.String |
getDeclarationAsString()
The declaration returned has this schema:
[accessSpecifier] [static] [abstract] [final] [native]
[synchronized] returnType methodName ([paramlist])
[throws exceptionsList]
|
java.lang.String |
getDeclarationAsString(boolean includingModifiers,
boolean includingThrows)
A simple representation of the element declaration.
|
JavadocComment |
getJavaDoc() |
int |
getModifiers()
Return the modifiers of this member declaration.
|
java.lang.String |
getName() |
NameExpr |
getNameExpr() |
java.util.List<Parameter> |
getParameters() |
java.util.List<NameExpr> |
getThrows() |
Type |
getType() |
java.util.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(java.lang.String name) |
void |
setNameExpr(NameExpr name) |
void |
setParameters(java.util.List<Parameter> parameters) |
void |
setThrows(java.util.List<NameExpr> throws_) |
void |
setType(Type type) |
void |
setTypeParameters(java.util.List<TypeParameter> typeParameters) |
getAnnotations, setAnnotationsaddOrphanComment, 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, toStringWithoutCommentspublic MethodDeclaration()
public MethodDeclaration(int modifiers,
Type type,
java.lang.String name)
public MethodDeclaration(int modifiers,
Type type,
java.lang.String name,
java.util.List<Parameter> parameters)
public MethodDeclaration(int modifiers,
java.util.List<AnnotationExpr> annotations,
java.util.List<TypeParameter> typeParameters,
Type type,
java.lang.String name,
java.util.List<Parameter> parameters,
int arrayCount,
java.util.List<NameExpr> throws_,
BlockStmt block)
public MethodDeclaration(int beginLine,
int beginColumn,
int endLine,
int endColumn,
int modifiers,
java.util.List<AnnotationExpr> annotations,
java.util.List<TypeParameter> typeParameters,
Type type,
java.lang.String name,
java.util.List<Parameter> parameters,
int arrayCount,
java.util.List<NameExpr> throws_,
BlockStmt block)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Nodepublic <A> void accept(VoidVisitor<A> v, A arg)
Nodepublic int getArrayCount()
public BlockStmt getBody()
public int getModifiers()
ModifierSetpublic java.lang.String getName()
public NameExpr getNameExpr()
public java.util.List<Parameter> getParameters()
public java.util.List<NameExpr> getThrows()
public Type getType()
public java.util.List<TypeParameter> getTypeParameters()
public void setArrayCount(int arrayCount)
public void setBody(BlockStmt body)
public void setModifiers(int modifiers)
public void setName(java.lang.String name)
public void setNameExpr(NameExpr name)
public void setJavaDoc(JavadocComment javadocComment)
setJavaDoc in interface DocumentableNodepublic void setParameters(java.util.List<Parameter> parameters)
public void setThrows(java.util.List<NameExpr> throws_)
public void setType(Type type)
public void setTypeParameters(java.util.List<TypeParameter> typeParameters)
public boolean isDefault()
public void setDefault(boolean isDefault)
public JavadocComment getJavaDoc()
getJavaDoc in interface DocumentableNodepublic java.lang.String getDeclarationAsString()
getDeclarationAsString in interface WithDeclarationpublic java.lang.String getDeclarationAsString(boolean includingModifiers,
boolean includingThrows)
WithDeclarationgetDeclarationAsString in interface WithDeclarationincludingModifiers - flag to include the modifiers (if present) in the string producedincludingThrows - flag to include the throws clause (if present) in the string producedCopyright © 2007-2015. All Rights Reserved.