Interface ASTSwitchLike

    • Field Summary

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

        COORDS_COMPARATOR
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default net.sourceforge.pmd.lang.ast.NodeStream<ASTSwitchBranch> getBranches()
      Returns a stream of all branches of this switch.
      default ASTExpression getTestedExpression()
      Gets the expression tested by this switch.
      default boolean hasDefaultCase()
      Returns true if this switch has a default case.
      default boolean isEnumSwitch()
      Returns true if this switch statement tests an expression having an enum type.
      default boolean isExhaustiveEnumSwitch()
      Returns true if this switch statement tests an expression having an enum type and all the constants of this type are covered by a switch case.
      default boolean isFallthroughSwitch()
      Returns true if this a switch which uses fallthrough branches (old school case label: break;) and not arrow branches.
      default Iterator<ASTSwitchBranch> iterator()  
      • 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.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 Detail

      • hasDefaultCase

        default boolean hasDefaultCase()
        Returns true if this switch has a default case.
      • getBranches

        default net.sourceforge.pmd.lang.ast.NodeStream<ASTSwitchBranch> getBranches()
        Returns a stream of all branches of this switch.
      • getTestedExpression

        default ASTExpression getTestedExpression()
        Gets the expression tested by this switch. This is the expression between the parentheses.
      • isExhaustiveEnumSwitch

        default boolean isExhaustiveEnumSwitch()
        Returns true if this switch statement tests an expression having an enum type and all the constants of this type are covered by a switch case. Returns false if the type of the tested expression could not be resolved.
      • isEnumSwitch

        default boolean isEnumSwitch()
        Returns true if this switch statement tests an expression having an enum type.
      • isFallthroughSwitch

        default boolean isFallthroughSwitch()
        Returns true if this a switch which uses fallthrough branches (old school case label: break;) and not arrow branches. If the switch has no branches, returns false.