I'm starting to work on a major new version of the Eclipse Checkstyle
plug-in and I have a question about the XML file used to configure
Checkstyle v3. Will Checkstyle ignore elements and attributes in the file
that it does not recognize? In other words, do you use the element and
attribute names to pull out just the values you need, using something like
XPath, and ignore the rest? It would be real nice if that were the case.
That would allow me to add additional information to the file for use with
the plug-in while preserving the ability to use the same XML file when
running Checkstyle from the command line or Ant.
One of the things I'd like to do is add to the XML document meta-data such
as the list of legal values for a checker's properties. For example, the
right curly brace check allows two possible values, 'nl' and 'alone'. If I
can identify in the XML file that a property can only take on values from an
enumerated set of values like this then I can build a configuration GUI with
a drop down list. That would be a lot nicer then the current plug-in, which
has a text entry field for each property. That forces the user to have to
go look up what the legal values are and type them in. This is both time
consuming and prone to errors.
It would also be useful if we could indicate the data type of the value,
such as Integer or String. That would allow me to do some validation on
what the user types in via the GUI.
I was thinking of something like the following:
<property name="option" type="String" value="alone">
<property name="checkstyle.tab.width" type="Integer" value="4"/>
This XML should be fully compatable with the existing code if the code
ignores elements and attributes it does not recognize. Let me know what you