Class ASTCompactConstructorDeclaration
java.lang.Object
net.sourceforge.pmd.lang.ast.impl.AbstractNode<B,N>
net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
net.sourceforge.pmd.lang.java.ast.ASTCompactConstructorDeclaration
- All Implemented Interfaces:
GenericNode<JavaNode>,JjtreeNode<JavaNode>,Node,TextAvailableNode,Annotatable,ASTBodyDeclaration,JavadocCommentOwner,JavaNode,ModifierOwner,ReturnScopeNode,SymbolDeclaratorNode,Reportable
public final class ASTCompactConstructorDeclaration
extends AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
implements ASTBodyDeclaration, SymbolDeclaratorNode, ModifierOwner, JavadocCommentOwner, ReturnScopeNode
This defines a compact constructor for a RecordDeclaration (JDK 16 feature).
Compact constructors implicitly declares formal parameters corresponding to the record component list. These can be
fetched from
getSymbol().
Compact record constructors must be declared "public".
CompactConstructorDeclaration ::=Modifiers<IDENTIFIER>Block
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sourceforge.pmd.lang.java.ast.ModifierOwner
ModifierOwner.Visibility -
Field Summary
FieldsFields inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode
idFields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptionfinal <P,R> R acceptVisitor(AstVisitor<? super P, ? extends R> visitor, P data) protected <P,R> R acceptVisitor(JavaVisitor<? super P, ? extends R> visitor, P data) protected voidaddChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) protected voidenlargeLeft(JavaccToken child) @NonNull ASTBlockgetBody()Deprecated.Since 7.14.0.Returns the node representing the type declaration this node is found in.getImage()final @NonNull ASTCompilationUnitgetRoot()Returns the symbol this node declares.@NonNull JSymbolTableReturns the symbol table for the program point represented by this node.Returns the type system with which this node was created.final Stringprotected voidinsertChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) voidjjtClose()protected voidremoveChildAtIndex(int childIndex) protected voidsetChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) protected voidsetFirstToken(JavaccToken token) protected voidprotected voidsetLastToken(JavaccToken token) Methods inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode
compareLocation, fitTokensToChildren, getFirstToken, getLastToken, getTextRegion, jjtOpen, toStringMethods inherited from class net.sourceforge.pmd.lang.ast.impl.AbstractNode
children, firstChild, getChild, getIndexInParent, getNumChildren, getParent, getUserMap, remove, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sourceforge.pmd.lang.java.ast.Annotatable
getAnnotation, isAnnotationPresent, isAnnotationPresent, isAnyAnnotationPresentMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode
ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSiblingMethods inherited from interface net.sourceforge.pmd.lang.java.ast.JavadocCommentOwner
getJavadocCommentMethods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode
getRoot, getSymbolTable, getTypeSystemMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode
getFirstToken, getLastToken, tokensMethods inherited from interface net.sourceforge.pmd.lang.java.ast.ModifierOwner
getDeclaredAnnotations, getEffectiveVisibility, getModifiers, getVisibility, hasExplicitModifiers, hasModifiers, hasVisibilityMethods inherited from interface net.sourceforge.pmd.lang.ast.Node
acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getIndexInParent, getLanguageVersion, getNumChildren, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundaryMethods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode
getOriginalText, getText, getTextRegion
-
Field Details
-
symbolTable
-
-
Method Details
-
getReportLocation
- Specified by:
getReportLocationin interfaceNode- Specified by:
getReportLocationin interfaceReportable
-
getImage
- Specified by:
getImagein interfaceNode- Overrides:
getImagein classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
acceptVisitor
-
getBody
- Specified by:
getBodyin interfaceReturnScopeNode
-
getDeclarationNode
Deprecated.Since 7.14.0. This method just returns `this` and isn't useful. -
getEnclosingType
Description copied from interface:JavaNodeReturns the node representing the type declaration this node is found in. The type of that node is the type of thethisexpression.This returns null for nodes that aren't enclosed in a type declaration. This includes PackageDeclaration, This includes ImportDeclaration, ModuleDeclaration, CompilationUnit, and top-level TypeDeclarations.
- Specified by:
getEnclosingTypein interfaceJavaNode
-
getSymbol
Description copied from interface:SymbolDeclaratorNodeReturns the symbol this node declares.- Specified by:
getSymbolin interfaceSymbolDeclaratorNode
-
jjtClose
public void jjtClose()- Overrides:
jjtClosein classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
acceptVisitor
- Specified by:
acceptVisitorin interfaceNode
-
addChild
protected void addChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) - Overrides:
addChildin classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
insertChild
protected void insertChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) - Overrides:
insertChildin classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
removeChildAtIndex
protected void removeChildAtIndex(int childIndex) - Overrides:
removeChildAtIndexin classAbstractNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setImage
- Overrides:
setImagein classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setFirstToken
- Overrides:
setFirstTokenin classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setLastToken
- Overrides:
setLastTokenin classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
enlargeLeft
- Overrides:
enlargeLeftin classAbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setChild
protected void setChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) - Overrides:
setChildin classAbstractNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
getSymbolTable
Description copied from interface:JavaNodeReturns the symbol table for the program point represented by this node.- Specified by:
getSymbolTablein interfaceJavaNode
-
getTypeSystem
Description copied from interface:JavaNodeReturns the type system with which this node was created. This is the object responsible for representing types in the compilation unit.- Specified by:
getTypeSystemin interfaceJavaNode
-
getRoot
-
getXPathNodeName
- Specified by:
getXPathNodeNamein interfaceNode
-