Class AttributeView<T extends KotlinNode>
java.lang.Object
net.sourceforge.pmd.lang.kotlin.ast.AttributeView<T>
- Type Parameters:
T- the corresponding ANTLR node
- All Implemented Interfaces:
Node,Reportable
- Direct Known Subclasses:
KtClassDeclarationAttributes,KtClassParameterAttributes,KtCompanionObjectAttributes,KtFunctionDeclarationAttributes,KtImportAliasAttributes,KtImportHeaderAttributes,KtVariableDeclarationAttributes
@Experimental
public abstract class AttributeView<T extends KotlinNode>
extends Object
implements Node
Base class for companion classes that allow to define additional attributes on
KotlinNodes generated by ANTLR.
The concrete subclasses are returned by KotlinInnerNode.attributes(Class)
for usage in Java-based rules. The attributes defined in the subclasses are
automatically available as XPath-Attributes.
Additionally, common attributes for multiple types can be defined as
interfaces, e.g. HasModifiers and HasSimpleIdentifier.
- Experimental Status:
- For Kotlin only, might be moved to pmd-core, if it proves useful
- Since:
- 7.25.0
-
Field Summary
FieldsFields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P,R> R acceptVisitor(AstVisitor<? super P, ? extends R> visitor, P data) <R extends Node>
NodeStream<R> asStream()children()<R extends Node>
NodeStream<R> intcompareLocation(Node other) static @Nullable AttributeView<?> create(KotlinNode kotlinNode) <R extends Node>
NodeStream.DescendantNodeStream<R> descendants(Class<? extends R> rClass) <R extends Node>
RfirstChild(Class<? extends R> rClass) intintgetChild(int index) intint@Nullable KotlinNodegetImage()Deprecated.Since 7.25.0.int@Nullable KotlinNode@Nullable KotlinNodefinal TgetNode()int@Nullable KotlinNode@NonNull RootNodegetRoot()@NonNull TextDocumentDataMap<DataMap.DataKey<?, ?>> booleanhasImageEqualTo(String image) Deprecated.Since 7.25.0.booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sourceforge.pmd.lang.ast.Node
getXPathAttributesIterator
-
Field Details
-
node
-
-
Constructor Details
-
AttributeView
-
-
Method Details
-
getNode
-
create
-
getChild
-
hasImageEqualTo
Deprecated.Since 7.25.0. Don't use getImage() or hasImageEqualTo()! See #4787.- Specified by:
hasImageEqualToin interfaceNode
-
getImage
Deprecated.Since 7.25.0. Don't use getImage() or hasImageEqualTo()! See #4787. -
getRoot
-
getLanguageVersion
- Specified by:
getLanguageVersionin interfaceNode
-
compareLocation
- Specified by:
compareLocationin interfaceNode
-
getReportLocation
- Specified by:
getReportLocationin interfaceNode- Specified by:
getReportLocationin interfaceReportable
-
getIndexInParent
public int getIndexInParent()- Specified by:
getIndexInParentin interfaceNode
-
ancestors
-
acceptVisitor
- Specified by:
acceptVisitorin interfaceNode
-
getTextDocument
- Specified by:
getTextDocumentin interfaceNode
-
getTextRegion
- Specified by:
getTextRegionin interfaceNode
-
children
-
getAstInfo
- Specified by:
getAstInfoin interfaceNode
-
descendants
- Specified by:
descendantsin interfaceNode
-
getBeginLine
public int getBeginLine()- Specified by:
getBeginLinein interfaceNode
-
isFindBoundary
- Specified by:
isFindBoundaryin interfaceNode
-
firstChild
- Specified by:
firstChildin interfaceNode
-
getBeginColumn
public int getBeginColumn()- Specified by:
getBeginColumnin interfaceNode
-
getXPathNodeName
- Specified by:
getXPathNodeNamein interfaceNode
-
getEndLine
public int getEndLine()- Specified by:
getEndLinein interfaceNode
-
getEndColumn
public int getEndColumn()- Specified by:
getEndColumnin interfaceNode
-
getNumChildren
public int getNumChildren()- Specified by:
getNumChildrenin interfaceNode
-
getUserMap
- Specified by:
getUserMapin interfaceNode
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode
-
getParent
-
getNextSibling
- Specified by:
getNextSiblingin interfaceNode
-
getLastChild
- Specified by:
getLastChildin interfaceNode
-
asStream
-
children
-
descendants
- Specified by:
descendantsin interfaceNode
-
descendantsOrSelf
- Specified by:
descendantsOrSelfin interfaceNode
-
ancestorsOrSelf
- Specified by:
ancestorsOrSelfin interfaceNode
-
ancestors
-
getPreviousSibling
- Specified by:
getPreviousSiblingin interfaceNode
-