Package com.github.sevntu.checkstyle
Class SevntuUtil
- java.lang.Object
-
- com.github.sevntu.checkstyle.SevntuUtil
-
public final class SevntuUtil extends Object
Simple utility class for all sevntu checks.- Author:
- Damian Szczepanik
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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).static void
reportInvalidToken(int token)
Reports passed token as unsupported by throwingIllegalArgumentException
exception.
-
-
-
Method Detail
-
reportInvalidToken
public static void reportInvalidToken(int token)
Reports passed token as unsupported by throwingIllegalArgumentException
exception. This utility method if used to mark that token passed toAbstractCheck.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 consideringsubTreeRoot
- 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
-
-