public final class ConstructorDeclaration extends BodyDeclaration<ConstructorDeclaration> implements NodeWithJavaDoc<ConstructorDeclaration>, NodeWithDeclaration, NodeWithName<ConstructorDeclaration>, NodeWithModifiers<ConstructorDeclaration>, NodeWithParameters<ConstructorDeclaration>, NodeWithThrowable<ConstructorDeclaration>, NodeWithBlockStmt<ConstructorDeclaration>
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE
Constructor and Description |
---|
ConstructorDeclaration() |
ConstructorDeclaration(EnumSet<Modifier> modifiers,
List<AnnotationExpr> annotations,
List<TypeParameter> typeParameters,
String name,
List<Parameter> parameters,
List<ReferenceType> throws_,
BlockStmt block) |
ConstructorDeclaration(EnumSet<Modifier> modifiers,
String name) |
ConstructorDeclaration(Range range,
EnumSet<Modifier> modifiers,
List<AnnotationExpr> annotations,
List<TypeParameter> typeParameters,
String name,
List<Parameter> parameters,
List<ReferenceType> throws_,
BlockStmt block) |
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.
|
BlockStmt |
getBody() |
String |
getDeclarationAsString()
As
NodeWithDeclaration.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
NodeWithDeclaration.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] className ([paramType [paramName]])
[throws exceptionsList]
|
JavadocComment |
getJavaDoc()
Gets the JavaDoc for this node.
|
EnumSet<Modifier> |
getModifiers()
Return the modifiers of this member declaration.
|
String |
getName() |
NameExpr |
getNameExpr() |
List<Parameter> |
getParameters() |
List<ReferenceType> |
getThrows() |
List<TypeParameter> |
getTypeParameters() |
ConstructorDeclaration |
setBody(BlockStmt body) |
ConstructorDeclaration |
setModifiers(EnumSet<Modifier> modifiers) |
ConstructorDeclaration |
setName(String name) |
ConstructorDeclaration |
setNameExpr(NameExpr name) |
ConstructorDeclaration |
setParameters(List<Parameter> parameters) |
ConstructorDeclaration |
setThrows(List<ReferenceType> throws_) |
void |
setTypeParameters(List<TypeParameter> typeParameters) |
getAnnotations, setAnnotations
addOrphanComment, clone, contains, equals, getAllContainedComments, getBegin, getChildrenNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeOfType, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, setAsParentNodeOf, setAsParentNodeOf, setBegin, setBlockComment, setComment, setData, setEnd, setLineComment, setParentNode, setRange, toString, toStringWithoutComments, tryAddImportToParentCompilationUnit
finalize, getClass, notify, notifyAll, wait, wait, wait
setJavaDocComment
addModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile
addAndGetParameter, addAndGetParameter, addAndGetParameter, addParameter, addParameter, addParameter, getParamByName, getParamByType, getParamByType
addThrows, addThrows, isThrows, isThrows
createBody
addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent
public ConstructorDeclaration()
public ConstructorDeclaration(EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, List<TypeParameter> typeParameters, String name, List<Parameter> parameters, List<ReferenceType> throws_, BlockStmt block)
public ConstructorDeclaration(Range range, EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, List<TypeParameter> typeParameters, String name, List<Parameter> parameters, List<ReferenceType> 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 EnumSet<Modifier> getModifiers()
getModifiers
in interface NodeWithModifiers<ConstructorDeclaration>
Modifier
public String getName()
getName
in interface NodeWithName<ConstructorDeclaration>
public NameExpr getNameExpr()
public List<Parameter> getParameters()
getParameters
in interface NodeWithParameters<ConstructorDeclaration>
public List<ReferenceType> getThrows()
getThrows
in interface NodeWithThrowable<ConstructorDeclaration>
public List<TypeParameter> getTypeParameters()
public ConstructorDeclaration setModifiers(EnumSet<Modifier> modifiers)
setModifiers
in interface NodeWithModifiers<ConstructorDeclaration>
public ConstructorDeclaration setName(String name)
setName
in interface NodeWithName<ConstructorDeclaration>
public ConstructorDeclaration setNameExpr(NameExpr name)
public ConstructorDeclaration setParameters(List<Parameter> parameters)
setParameters
in interface NodeWithParameters<ConstructorDeclaration>
public ConstructorDeclaration setThrows(List<ReferenceType> throws_)
setThrows
in interface NodeWithThrowable<ConstructorDeclaration>
public void setTypeParameters(List<TypeParameter> typeParameters)
public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName)
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 producedpublic 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 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 JavadocComment getJavaDoc()
NodeWithJavaDoc
getJavaDoc
in interface NodeWithJavaDoc<ConstructorDeclaration>
public BlockStmt getBody()
getBody
in interface NodeWithBlockStmt<ConstructorDeclaration>
public ConstructorDeclaration setBody(BlockStmt body)
setBody
in interface NodeWithBlockStmt<ConstructorDeclaration>
Copyright © 2007–2016. All rights reserved.