Interface ASTPattern
-
- All Superinterfaces:
JavaNode
,Node
,ScopedNode
- All Known Implementing Classes:
ASTGuardedPattern
,ASTTypePattern
public interface ASTPattern extends JavaNode
A pattern (for pattern matching constructs likeInstanceOfExpression
or within aASTSwitchLabel
). This is a JDK 16 feature.This interface will be implemented by all forms of patterns. For now, only type test patterns are supported. Record deconstruction patterns is planned for a future JDK version.
Pattern ::=
TypePattern
|GuardedPattern
- See Also:
- JEP 394: Pattern Matching for instanceof
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getParenthesisDepth()
Returns the number of parenthesis levels around this pattern.-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode
children, childrenAccept, getChild, getParent, getRoot, jjtAccept, setScope
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.Node
findChildNodesWithXPath, findChildrenOfType, findDescendantsOfType, findDescendantsOfType, findDescendantsOfType, getAsDocument, getBeginColumn, getBeginLine, getDataFlowNode, getEndColumn, getEndLine, getFirstChildOfType, getFirstDescendantOfType, getFirstParentOfAnyType, getFirstParentOfType, getImage, getIndexInParent, getNthParent, getNumChildren, getParentsOfType, getUserData, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasDescendantMatchingXPath, hasDescendantOfType, hasImageEqualTo, isFindBoundary, jjtAddChild, jjtClose, jjtGetChild, jjtGetChildIndex, jjtGetId, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetChildIndex, jjtSetParent, remove, removeChildAtIndex, setDataFlowNode, setImage, setUserData
-
Methods inherited from interface net.sourceforge.pmd.lang.symboltable.ScopedNode
getScope
-
-
-
-
Method Detail
-
getParenthesisDepth
@Experimental int getParenthesisDepth()
Returns the number of parenthesis levels around this pattern. If this method returns 0, then no parentheses are present.
-
-