From 7487d755dcff144f1957062e8079b0d079aba7fd Mon Sep 17 00:00:00 2001
From: Vladislav Lisetskiy visitToken().
visitToken().
It is important to understand that the individual Checks do no drive the AST traversal (it possible to traverse itself, but not recommended). @@ -208,16 +208,16 @@ java -cp checkstyle-${projectVersion}-all.jar com.puppycrawl.tools.checkstyle.gu
Before any visitor method is called, the TreeWalker
will call beginTree() to give the Check a chance to do
+ href="apidocs/com/puppycrawl/tools/checkstyle/api/AbstractCheck.html#beginTree-com.puppycrawl.tools.checkstyle.api.DetailAST-">beginTree() to give the Check a chance to do
some initialization. Then, when performing the recursive descend from
the root to the leaf nodes, the visitToken()
method is called. Unlike the basic examples in the pattern book, there
is a visitToken() counterpart called leaveToken(). The TreeWalker will call that
+ href="apidocs/com/puppycrawl/tools/checkstyle/api/AbstractCheck.html#leaveToken-com.puppycrawl.tools.checkstyle.api.DetailAST-">leaveToken(). The TreeWalker will call that
method to signal that the subtree below the node has been processed and
the TreeWalker is backtracking from the node. After the root node has
been left, the TreeWalker will call finishTree().
finishTree().
@@ -550,7 +550,7 @@ java -classpath mycompanychecks.jar;checkstyle-${projectVersion}-all.jar \
inherit from AbstractFileSetCheck
and override the abstract processFiltered(java.io.File, java.util.List) method and you're
+ href="apidocs/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.html#processFiltered-java.io.File-java.util.List-">processFiltered(java.io.File, java.util.List) method and you're
done. A very simple example could fire an error if the number of files
exceeds a certain limit. Here is a FileSetCheck that does just that: