ConstructorDeclaration
open class ConstructorDeclaration : CallableDeclaration<ConstructorDeclaration> , NodeWithOptionalBlockStmt<ConstructorDeclaration> , NodeWithAccessModifiers<ConstructorDeclaration> , NodeWithJavadoc<ConstructorDeclaration> , NodeWithSimpleName<ConstructorDeclaration> , NodeWithParameters<ConstructorDeclaration> , NodeWithThrownExceptions<ConstructorDeclaration> , NodeWithTypeParameters<ConstructorDeclaration> , Resolvable<ResolvedConstructorDeclaration> (source)
A constructor declaration: 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.
Author
Julio Vilmar Gesser
Constructors
Link copied to clipboard
constructor()
constructor(modifiers: NodeList<Modifier>, annotations: NodeList<AnnotationExpr>, typeParameters: NodeList<TypeParameter>, name: SimpleName, parameters: NodeList<Parameter>, thrownExceptions: NodeList<ReferenceType>, body: BlockStmt)
constructor(modifiers: NodeList<Modifier>, annotations: NodeList<AnnotationExpr>, typeParameters: NodeList<TypeParameter>, name: SimpleName, parameters: NodeList<Parameter>, thrownExceptions: NodeList<ReferenceType>, body: BlockStmt, receiverParameter: ReceiverParameter, contracts: NodeList<JmlContract>)
constructor(range: TokenRange, modifiers: NodeList<Modifier>, annotations: NodeList<AnnotationExpr>, list: NodeList<TypeParameter>, name: SimpleName, parameters: NodeList<Parameter>, thrownExceptions: NodeList<ReferenceType>, stmt: BlockStmt, receiverParameter: ReceiverParameter)
constructor(tokenRange: TokenRange, modifiers: NodeList<Modifier>, annotations: NodeList<AnnotationExpr>, typeParameters: NodeList<TypeParameter>, name: SimpleName, parameters: NodeList<Parameter>, thrownExceptions: NodeList<ReferenceType>, body: BlockStmt, receiverParameter: ReceiverParameter, contracts: NodeList<JmlContract>)
This constructor is used by the parser and is considered private.
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
This can be used to sort nodes on position.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
Annotates this node and automatically add the import
Annotates this
Link copied to clipboard
Remember to import the class in the compilation unit yourself
Link copied to clipboard
Annotates this node and automatically add the import
Annotates this
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Annotates this with a marker annotation and automatically add the import
Annotates this with a marker annotation
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Remember to import the class in the compilation unit yourself
Link copied to clipboard
Annotates this with a single member annotation
Annotates this with a single member annotation and automatically add the import
Link copied to clipboard
Adds this type to the throws clause
Adds this class to the throws clause
Link copied to clipboard
Adds a type parameter like
X extends SerializableLink copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Checks whether the range of the given
Node is contained within the range of this NodeWithRange.Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Walks the AST with pre-order traversal, returning all nodes of type "nodeType".
Walks the AST with specified traversal order, returning all nodes of type "nodeType".
Walks the AST with pre-order traversal, returning all nodes of type "nodeType" that match the predicate.
Link copied to clipboard
Walks the parents of this node and returns the first node of type
type, or empty() if none is found.Walks the parents of this node and returns the first node of type
type that matches predicate, or empty() if none is found.Walks the parents of this node and returns the first node that matches one of types
types, or empty() if none is found.Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Walks the AST with pre-order traversal, returning the first node of type "nodeType" or empty() if none is found.
Walks the AST, applying the function for every node, with traversal algorithm "traversal".
Walks the AST with pre-order traversal, returning the first node of type "nodeType" that matches "predicate" or empty() if none is found.
Link copied to clipboard
Finds the root node of this AST by finding the topmost parent.
Link copied to clipboard
Link copied to clipboard
This is the list of Comment which are contained in the Node either because they are properly associated to one of its children or because they are floating around inside the Node
Link copied to clipboard
Link copied to clipboard
Try to find an annotation by its class
Link copied to clipboard
Try to find an annotation by its name
Link copied to clipboard
This field is used by key to associated (JML) comments to this node.
Link copied to clipboard
Contains all nodes that have this node set as their parent.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
This method was added to support the clone method.
Link copied to clipboard
open fun getDeclarationAsString(includingModifiers: Boolean, includingThrows: Boolean, includingParameterName: Boolean): String
The declaration returned has this schema: [accessSpecifier] className ([paramType [paramName]]) [throws exceptionsList]
As getDeclarationAsString including the modifiers, the throws clause and the parameters with both type and name.
As getDeclarationAsString including the parameters with both type and name.
Link copied to clipboard
Gets the Javadoc for this node.
Link copied to clipboard
Gets the JavadocComment for this node.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
This is a list of Comment which are inside the node and are not associated with any meaningful AST Node.
Link copied to clipboard
Link copied to clipboard
Try to find a Parameter by its name
Link copied to clipboard
Try to find a Parameter by its type
Link copied to clipboard
Returns the parent node, or
Optional.empty if no parent is set.Link copied to clipboard
Returns the parent node from the perspective of the children of this node.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Check if the parameters have certain types.
Link copied to clipboard
Returns true if the parent has a parent
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Determines whether this node is an ancestor of the given node.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Check whether an annotation with this class is present on this element
Check whether an annotation with this name is present on this element
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Determines whether this
HasParentNode node is a descendant of the given node.Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Was this observer registered?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Register an observer.
Register a new observer for the given node.
Link copied to clipboard
Register the observer for the current node and all the contained node and nodelists, recursively.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Remove data by key.
Link copied to clipboard
Forcibly removes this node from the AST.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setAssociatedSpecificationComments(@Nullable associatedSpecificationComments: @Nullable NodeList<Comment>): Node
Link copied to clipboard
Use this to store additional information to this node.
Link copied to clipboard
Sets the body
Link copied to clipboard
Set a JavadocComment for this node
Link copied to clipboard
Use this to store additional information to this node.
Link copied to clipboard
Link copied to clipboard
Creates a list of modifier nodes corresponding to the keywords passed, and set it.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Unregister an observer.
Link copied to clipboard
Walks the AST, calling the consumer for every node with pre-order traversal.
Walks the AST, calling the consumer for every node, with traversal algorithm "traversal".
Walks the AST with pre-order traversal, calling the consumer for every node of type "nodeType".