class X { X() { } } where X(){} is the constructor declaration.
All annotations preceding the name will be set on this object, not on the class.
JavaParser doesn't know if it they are applicable to the method or the class.
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | ConstructorDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body)
|
| public | ConstructorDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter)
|
| public | ConstructorDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, 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 | |
| ConstructorDeclaration | back to summary |
|---|---|
| public ConstructorDeclaration() | |
| ConstructorDeclaration | back to summary |
|---|---|
| public ConstructorDeclaration(String name) | |
| ConstructorDeclaration | back to summary |
|---|---|
| public ConstructorDeclaration(NodeList<Modifier> modifiers, String name) | |
| ConstructorDeclaration | back to summary |
|---|---|
| public ConstructorDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body) | |
| ConstructorDeclaration | back to summary |
|---|---|
public ConstructorDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt body, ReceiverParameter receiverParameter)
| |
| ConstructorDeclaration | back to summary |
|---|---|
| public ConstructorDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, 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.
| |
| asConstructorDeclaration | back to summary |
|---|---|
| public ConstructorDeclaration asConstructorDeclaration() Overrides com.
| |
| clone | back to summary |
|---|---|
| public ConstructorDeclaration 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 BlockStmt getBody() Implements com.
| |
| getDeclarationAsString | back to summary |
|---|---|
| public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows, boolean includingParameterName) Implements com. The declaration returned has this schema: [accessSpecifier] className ([paramType [paramName]]) [throws exceptionsList]
| |
| getMetaModel | back to summary |
|---|---|
| public ConstructorDeclarationMetaModel getMetaModel() Overrides com.
| |
| ifConstructorDeclaration | back to summary |
|---|---|
| public void ifConstructorDeclaration(Consumer<ConstructorDeclaration> action) Overrides com.
| |
| isConstructorDeclaration | back to summary |
|---|---|
| public boolean isConstructorDeclaration() Overrides com.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Node node) Overrides com.
| |
| replace | back to summary |
|---|---|
| public boolean replace(Node node, Node replacementNode) Overrides com.
| |
| resolve | back to summary |
|---|---|
| public ResolvedConstructorDeclaration resolve() Implements com.
| |
| setBody | back to summary |
|---|---|
| public ConstructorDeclaration setBody(final BlockStmt body) Implements com. Sets the body
| |
| setModifiers | back to summary |
|---|---|
| public ConstructorDeclaration setModifiers(final NodeList<Modifier> modifiers) Overrides com. Implements com.
| |
| setName | back to summary |
|---|---|
| public ConstructorDeclaration setName(final SimpleName name) Overrides com. Implements com.
| |
| setParameters | back to summary |
|---|---|
| public ConstructorDeclaration setParameters(final NodeList<Parameter> parameters) Overrides com. Implements com.
| |
| setThrownExceptions | back to summary |
|---|---|
| public ConstructorDeclaration setThrownExceptions(final NodeList<ReferenceType> thrownExceptions) Overrides com. Implements com.
| |
| setTypeParameters | back to summary |
|---|---|
| public ConstructorDeclaration setTypeParameters(final NodeList<TypeParameter> typeParameters) Overrides com. Implements com.
| |
| toConstructorDeclaration | back to summary |
|---|---|
| public Optional Overrides com.
| |