Class CompactConstructorDeclaration

All Implemented Interfaces:
NodeWithAccessModifiers<CompactConstructorDeclaration>, NodeWithPrivateModifier<CompactConstructorDeclaration>, NodeWithProtectedModifier<CompactConstructorDeclaration>, NodeWithPublicModifier<CompactConstructorDeclaration>, NodeWithAnnotations<CompactConstructorDeclaration>, NodeWithBlockStmt<CompactConstructorDeclaration>, NodeWithJavadoc<CompactConstructorDeclaration>, NodeWithModifiers<CompactConstructorDeclaration>, NodeWithRange<Node>, NodeWithSimpleName<CompactConstructorDeclaration>, NodeWithThrownExceptions<CompactConstructorDeclaration>, NodeWithTokenRange<Node>, NodeWithTypeParameters<CompactConstructorDeclaration>, Observable, Visitable, HasParentNode<Node>, Resolvable<ResolvedConstructorDeclaration>, Cloneable

The record declaration's constructor

WARNING: This implementation is subject to change.

Java 1.0 to 13

Not available.

Java 14 (preview), Java 15 (2nd preview), Java 16

A record "compact" constructor declaration: class X(int a, int b) { public X{ } } where public X{} is the compact record constructor declaration.

Note that the record constructor is distinct from a "standard" constructor as it does not permit arguments/parameters.

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.

Since:
3.22.0
Author:
Roger Howell
See Also:
JLS 8.10 - Record Classes, JLS 8.10.3 - Record Constructor Declarations