Class ASTTypeExpression
- All Implemented Interfaces:
net.sourceforge.pmd.lang.ast.impl.GenericNode<JavaNode>,net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode<JavaNode>,net.sourceforge.pmd.lang.ast.Node,net.sourceforge.pmd.lang.ast.TextAvailableNode,ASTExpression,ASTMemberValue,ASTPrimaryExpression,ASTSwitchArrowRHS,JavaNode,TypeNode,net.sourceforge.pmd.reporting.Reportable
public final class ASTTypeExpression
extends net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
implements ASTPrimaryExpression
Wraps a type node but presents the interface of
ASTExpression.
This is only used in the following contexts:
- As the right-hand side of
instanceof expressions. - As the qualifier of method calls,
field accesses, when they access a static method or field - As the qualifier of method references, if it references a static method, or is a constructor reference
TypeExpression ::= Type
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sourceforge.pmd.lang.java.ast.ASTExpression
ASTExpression.ConstResult -
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(net.sourceforge.pmd.lang.ast.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(net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken child) default @NonNull JavaNodeReturns the first child of this node, never null.default @NonNull JavaNodeReturns the last child of this node, never null.intReturns 0, type expressions can never be parenthesized.final @NonNull ASTCompilationUnitgetRoot()@NonNull JSymbolTableReturns the symbol table for the program point represented by this node.@NonNull JTypeMirrorGets the wrapped type node.Returns the type system with which this node was created.final Stringprotected voidinsertChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) booleanReturns false, type expressions can never be parenthesized.voidjjtClose()protected voidremoveChildAtIndex(int childIndex) protected voidsetChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) protected voidsetFirstToken(net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken token) protected voidprotected voidsetLastToken(net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken token) Methods inherited from class net.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode
compareLocation, fitTokensToChildren, getFirstToken, getImage, 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.ASTExpression
getConstFoldingResult, getConstValue, getConversionContext, isCompileTimeConstant, isExpressionMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode
ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getNextSibling, getParent, getPreviousSiblingMethods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode
getEnclosingType, getRoot, getSymbolTable, getTypeSystemMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode
getFirstToken, getLastToken, tokensMethods inherited from interface net.sourceforge.pmd.lang.ast.Node
acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getIndexInParent, getLanguageVersion, getNumChildren, getReportLocation, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundaryMethods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode
getOriginalText, getText, getTextRegionMethods inherited from interface net.sourceforge.pmd.lang.java.ast.TypeNode
getTypeMirror
-
Field Details
-
symbolTable
-
-
Method Details
-
acceptVisitor
-
getTypeNode
Gets the wrapped type node. -
getParenthesisDepth
public int getParenthesisDepth()Returns 0, type expressions can never be parenthesized.- Specified by:
getParenthesisDepthin interfaceASTExpression
-
isParenthesized
public boolean isParenthesized()Returns false, type expressions can never be parenthesized.- Specified by:
isParenthesizedin interfaceASTExpression
-
getTypeMirror
- Specified by:
getTypeMirrorin interfaceTypeNode
-
getFirstChild
Returns the first child of this node, never null.- Specified by:
getFirstChildin interfacenet.sourceforge.pmd.lang.ast.impl.GenericNode<JavaNode>- Specified by:
getFirstChildin interfacenet.sourceforge.pmd.lang.ast.Node
-
getLastChild
Returns the last child of this node, never null.- Specified by:
getLastChildin interfacenet.sourceforge.pmd.lang.ast.impl.GenericNode<JavaNode>- Specified by:
getLastChildin interfacenet.sourceforge.pmd.lang.ast.Node
-
jjtClose
public void jjtClose()- Overrides:
jjtClosein classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
acceptVisitor
public final <P,R> R acceptVisitor(net.sourceforge.pmd.lang.ast.AstVisitor<? super P, ? extends R> visitor, P data) - Specified by:
acceptVisitorin interfacenet.sourceforge.pmd.lang.ast.Node
-
addChild
protected void addChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) - Overrides:
addChildin classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
insertChild
protected void insertChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) - Overrides:
insertChildin classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
removeChildAtIndex
protected void removeChildAtIndex(int childIndex) - Overrides:
removeChildAtIndexin classnet.sourceforge.pmd.lang.ast.impl.AbstractNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setImage
- Overrides:
setImagein classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setFirstToken
protected void setFirstToken(net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken token) - Overrides:
setFirstTokenin classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setLastToken
protected void setLastToken(net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken token) - Overrides:
setLastTokenin classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
enlargeLeft
protected void enlargeLeft(net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken child) - Overrides:
enlargeLeftin classnet.sourceforge.pmd.lang.ast.impl.javacc.AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,JavaNode>
-
setChild
protected void setChild(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child, int index) - Overrides:
setChildin classnet.sourceforge.pmd.lang.ast.impl.AbstractNode<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 interfacenet.sourceforge.pmd.lang.ast.Node
-