Help required on writing a new Check

Nitin Bhardwaj <[email protected]> Thu, 23 Apr 2009 11:49:21 +0530
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
Hi Friends,

I am a new user of Checkstyle. I am using Checkstyle 4.4 on Windows XP with
JDK1.6 and Ant 1.7
I've to write a check which can identify the java classes which implements
java.io.Serializable and further I've to check that whether they have
defined a serialVersionUID field or not.
My approach is to write a new check class which extends
com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.
Right now I just know a little bit about how to traverse and check for
conditions inside a specific Java file using public void
visitToken(DetailAST aAST)  method.
However, I don't know about the following scenario:
(i) How to traverse through a set of files?
(ii) How to check these files for a particular condition (like a class which
implements a particular interface etc.) and select files on the basis of
this condition.?
(iii) How to get a DetailAST for a file selected in (ii) step?

I'll really like to learn about the basic concepts of writing new checks.
Any help, probably in the form of some other similar type of check's code /
documentation / or concept, is greatly appreciated.

Best Regards,
Nitin Bhardwaj

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p

_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user