Interface ASTLoopStatement

All Superinterfaces:
ASTStatement, net.sourceforge.pmd.lang.ast.impl.GenericNode<JavaNode>, JavaNode, net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode<JavaNode>, net.sourceforge.pmd.lang.ast.Node, net.sourceforge.pmd.reporting.Reportable, net.sourceforge.pmd.lang.ast.TextAvailableNode
All Known Implementing Classes:
ASTDoStatement, ASTForeachStatement, ASTForStatement, ASTWhileStatement

public interface ASTLoopStatement extends ASTStatement
A loop statement.

 Statement ::= DoStatement
             | ForeachStatement
             | ForStatement
             | WhileStatement

 
  • Field Summary

    Fields inherited from interface net.sourceforge.pmd.lang.ast.Node

    COORDS_COMPARATOR
  • Method Summary

    Modifier and Type
    Method
    Description
    default ASTStatement
    Returns the statement that represents the body of this loop.
    default @Nullable ASTExpression
    Returns the node that represents the condition of this loop.

    Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode

    ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSibling

    Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode

    getEnclosingType, getRoot, getSymbolTable, getTypeSystem

    Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode

    getFirstToken, getLastToken, tokens

    Methods 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, isFindBoundary

    Methods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode

    getOriginalText, getText, getTextRegion
  • Method Details

    • getBody

      default ASTStatement getBody()
      Returns the statement that represents the body of this loop.
    • getCondition

      default @Nullable ASTExpression getCondition()
      Returns the node that represents the condition of this loop. This may be any expression of type boolean.

      If there is no specified guard, then returns null (in particular, returns null if this is a foreach loop).