Class SevntuUtil


  • public final class SevntuUtil
    extends Object
    Simple utility class for all sevntu checks.
    Author:
    Damian Szczepanik
    • Method Detail

      • reportInvalidToken

        public static void reportInvalidToken​(int token)
        Reports passed token as unsupported by throwing IllegalArgumentException exception. This utility method if used to mark that token passed to AbstractCheck.visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST) is not supported by this method.
        Parameters:
        token - token/type that is not supported
        Throws:
        IllegalArgumentException - always
      • getNextSubTreeNode

        public static com.puppycrawl.tools.checkstyle.api.DetailAST getNextSubTreeNode​(com.puppycrawl.tools.checkstyle.api.DetailAST node,
                                                                                       com.puppycrawl.tools.checkstyle.api.DetailAST subTreeRoot)
        Gets the next node of a syntactical tree (child of a current node or sibling of a current node, or sibling of a parent of a current node).
        Parameters:
        node - Current node in considering
        subTreeRoot - The root node of the subtree. Can be a top level root node
        Returns:
        Current node after bypassing, if current node reached the root of a subtree method returns null