Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > 9acaaf085def5d3a354826f8f266e9dc > files > 6

checkstyle-manual-4.4-0.0.3mdv2010.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- Content Stylesheet for Site -->

    
    

    
<!-- start the processing -->
    <!-- ====================================================================== -->
    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
    <!-- Main Page Section -->
    <!-- ====================================================================== -->
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />

                          <meta name="author" content="Lars K?hne">
            <meta name="email" content="$au.getAttributeValue("email")">
    
    
            
        
    <title>Checkstyle - Configuration</title>

    <style type="text/css" media="all">
      @import url("./css/cs-layout.css");
      @import url("./css/cs-style.css");
    </style>
  </head>

  <body>
    <div class="csTopBar">
      <div class="csTopBarContents">
        <div class="csLeft">
          <h1>Configuration</h1>
        </div>
        <div class="csRight">
          <a href="http://checkstyle.sourceforge.net/">
            <img src="images/logo.png" alt="Checkstyle Logo" height="70"/>
          </a>
        </div>
      </div>
    </div>


    <div class="csMiddleContainer">
      <div class="csLeftBar">
        <div class="csLeftBarContents">
            <!-- ============================================================ -->
  <!-- start makeNavigationBar -->
  
  <ul>
          <li>
        <strong>About</strong>
      </li>
                        <li>    <a href="./index.html">Checkstyle</a>
</li>
                    
  
          <li>
        <strong>Documentation</strong>
      </li>
                        <li>    <a href="./releasenotes.html">Release Notes</a>
</li>
                    
                  <li><b>    <a href="./config.html">Configuration</a>
</b></li>
                                                      <li><a href="#Overview">&nbsp;&nbsp;&nbsp;Overview</a></li>
                                                        <li><a href="#Modules">&nbsp;&nbsp;&nbsp;Modules</a></li>
                                                        <li><a href="#Properties">&nbsp;&nbsp;&nbsp;Properties</a></li>
                                                        <li><a href="#Checker">&nbsp;&nbsp;&nbsp;Checker</a></li>
                                                        <li><a href="#TreeWalker">&nbsp;&nbsp;&nbsp;TreeWalker</a></li>
                                                        <li><a href="#TreeWalker Checks">&nbsp;&nbsp;&nbsp;TreeWalker Checks</a></li>
                                                        <li><a href="#Severity">&nbsp;&nbsp;&nbsp;Severity</a></li>
                                                        <li><a href="#Filters">&nbsp;&nbsp;&nbsp;Filters</a></li>
                                                        <li><a href="#AuditListeners">&nbsp;&nbsp;&nbsp;AuditListeners</a></li>
                                                        <li><a href="#Packages">&nbsp;&nbsp;&nbsp;Packages</a></li>
                                                        <li><a href="#XML Details">&nbsp;&nbsp;&nbsp;XML Details</a></li>
                                                      <li>    <a href="./property_types.html">&nbsp;&nbsp;&nbsp;Property Types</a>
</li>
                    
  
                  <li>    <a href="./running.html">Running</a>
</li>
                                    <li>    <a href="./anttask.html">&nbsp;&nbsp;&nbsp;Ant Task</a>
</li>
                    
                  <li>    <a href="./cmdline.html">&nbsp;&nbsp;&nbsp;Command Line</a>
</li>
                    
  
                  <li>    <a href="./availablechecks.html">Available Checks</a>
</li>
                    
                  <li>    <a href="./checks.html">Standard Checks</a>
</li>
                                    <li>    <a href="./config_javadoc.html">&nbsp;&nbsp;&nbsp;Javadoc Comments</a>
</li>
                    
                  <li>    <a href="./config_naming.html">&nbsp;&nbsp;&nbsp;Naming Conventions</a>
</li>
                    
                  <li>    <a href="./config_header.html">&nbsp;&nbsp;&nbsp;Headers</a>
</li>
                    
                  <li>    <a href="./config_imports.html">&nbsp;&nbsp;&nbsp;Imports</a>
</li>
                    
                  <li>    <a href="./config_sizes.html">&nbsp;&nbsp;&nbsp;Size Violations</a>
</li>
                    
                  <li>    <a href="./config_whitespace.html">&nbsp;&nbsp;&nbsp;Whitespace</a>
</li>
                    
                  <li>    <a href="./config_modifier.html">&nbsp;&nbsp;&nbsp;Modifiers</a>
</li>
                    
                  <li>    <a href="./config_blocks.html">&nbsp;&nbsp;&nbsp;Block Checks</a>
</li>
                    
                  <li>    <a href="./config_coding.html">&nbsp;&nbsp;&nbsp;Coding</a>
</li>
                    
                  <li>    <a href="./config_design.html">&nbsp;&nbsp;&nbsp;Class Design</a>
</li>
                    
                  <li>    <a href="./config_duplicates.html">&nbsp;&nbsp;&nbsp;Duplicate Code</a>
</li>
                    
                  <li>    <a href="./config_metrics.html">&nbsp;&nbsp;&nbsp;Metrics</a>
</li>
                    
                  <li>    <a href="./config_misc.html">&nbsp;&nbsp;&nbsp;Miscellaneous</a>
</li>
                    
  
                  <li>    <a href="./optional.html">Optional Checks</a>
</li>
                                    <li>    <a href="./config_j2ee.html">&nbsp;&nbsp;&nbsp;J2EE Checks</a>
</li>
                    
  
                  <li>    <a href="./extending.html">Extending Checkstyle</a>
</li>
                                    <li>    <a href="./writingchecks.html">&nbsp;&nbsp;&nbsp;Writing checks</a>
</li>
                    
                  <li>    <a href="./writingfilters.html">&nbsp;&nbsp;&nbsp;Writing filters</a>
</li>
                    
                  <li>    <a href="./writinglisteners.html">&nbsp;&nbsp;&nbsp;Writing listeners</a>
</li>
                    
  
                  <li>    <a href="./api/index.html">Javadoc</a>
</li>
                    
  
          <li>
        <strong>SourceForge</strong>
      </li>
                        <li>    <a href="http://sourceforge.net/mail/?group_id=29721">Mailing Lists</a>
</li>
                    
                  <li>    <a href="http://sourceforge.net/tracker/?atid=397078&group_id=29721&func=browse">Bug Database</a>
</li>
                    
                  <li>    <a href="http://sourceforge.net/tracker/?atid=397081&group_id=29721&func=browse">Feature Requests</a>
</li>
                    
  
          <li>
        <strong>Developers</strong>
      </li>
                        <li>    <a href="http://sourceforge.net/projects/checkstyle">Project Page</a>
</li>
                    
                  <li>    <a href="http://checkstyle.svn.sourceforge.net/viewvc/checkstyle/">SVN Repository</a>
</li>
                    
                  <li>    <a href="./contributing.html">Contributing</a>
</li>
                    
  
      </ul>

  <ul>
    <li>
      <strong>Hosted by:</strong>
      <div align="center">
        <p><a href="http://sourceforge.net">
        <img src="http://sourceforge.net/sflogo.php?group_id=29721&amp;type=1" width="88" height="31" alt="SourceForge Logo"/></a>
         </p>
       </div>
    </li>
  </ul>

  <!-- end makeNavigationBar -->
  <!-- ============================================================ -->
        </div>
      </div>

      <div class="csMain">
                          <a id="Overview"></a>
  <h2>Overview</h2>
                                    <p>
        A Checkstyle configuration specifies which <em>modules</em> to
        plug in and apply to Java source files. Modules are structured
        in a tree whose root is the <em>Checker</em> module. The next
        level of modules contains:
      </p>
                                                <ul>

        <li><em>FileSetChecks</em> - modules that take a set of input
        files and fire error messages.</li>

        <li><em>Filters</em>

        - modules that filter audit events,
        including error messages, for acceptance.</li>

        <li><em>AuditListeners</em> - modules that report accepted events.</li>

      </ul>
                                                <p>
        Many checks are submodules of the <em>TreeWalker</em>
        FileSetCheck module. The TreeWalker operates by separately
        transforming each of the Java source files into an abstract
        syntax tree and then handing the result over to each of its
        submodules which in turn have a look at certain aspects of the
        tree.
      </p>
                                                <p>
        Checkstyle obtains a configuration from an XML document whose
        elements specify the configuration's hierarchy of modules and
        their properties. You provide a file that contains the
        configuration document when you invoke Checkstyle at the <a href="cmdline.html">command line</a>, and when you run a <a href="anttask.html">Checkstyle task</a> in ant. The
        documentation directory of the Checkstyle distribution contains
        a sample configuration file <em>sun_checks.xml</em> which
        configures Checkstyle to check for the Sun coding conventions.
      </p>
                                                      <a id="Modules"></a>
  <h2>Modules</h2>
                                    <p>
        A <span class="code">module</span> element in the configuration
        XML document specifies a module identified by the element's
        <span class="code">name</span> attribute.
      </p>
                                                <p>
        Here is a fragment of a typical configuration document:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Checker&quot;&gt;
    &lt;module name=&quot;PackageHtml&quot;/&gt;
    &lt;module name=&quot;TreeWalker&quot;&gt;
        &lt;module name=&quot;AvoidStarImport&quot;/&gt;
        &lt;module name=&quot;ConstantName&quot;/&gt;
        &lt;module name=&quot;EmptyBlock&quot;/&gt;
    &lt;/module&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        In this configuration:
      </p>
                                                <ul>
        <li>
          Root module <span class="code">Checker</span> has child
          FileSetChecks <span class="code"> PackageHtml</span> and <span class="code">TreeWalker</span>. (Module <a href="config_javadoc.html"> <span class="code">PackageHtml</span></a> checks that all packages
          have package documentation.)
        </li>
        <li>
          Module <span class="code">TreeWalker</span> has submodules
          <span class="code">AvoidStarImport</span>, <span class="code">ConstantName</span>, and <span class="code">EmptyBlock</span>.  (Modules <a href="config_import.html"><span class="code">AvoidStarImport</span></a>, <a href="config_naming.html"><span class="code">ConstantName</span></a>, and <a href="config_blocks.html"><span class="code">EmptyBlock</span></a> check that a Java source
          file has no star imports, has valid constant names, and has no
          empty blocks, respectively.)
        </li>
      </ul>
                                                <p>
        For each configuration module, Checkstyle loads a class
        identified by the <span class="code">name</span> attribute of
        the <span class="code">module</span>.  There are several rules
        for loading a module's class:
      </p>
                                                <ol>
        <li>
          Load a class directly according to a package-qualified <span class="code">name</span>, such as loading class <span class="code">com.puppycrawl.tools.checkstyle.TreeWalker</span>
          for element:

          <source>
&lt;module name="com.puppycrawl.tools.checkstyle.TreeWalker"&gt;
          </source>

          This is useful for plugging third-party modules into a configuration.
        </li>

        <li>
          Load a class of a pre-specified package, such as loading class
          <span class="code">com.puppycrawl.tools.checkstyle.checks.AvoidStarImport</span>
          for element
          <source>
&lt;module name="AvoidStarImport"/&gt;
          </source>

          Checkstyle applies packages <span class="code">
          com.puppycrawl.tools.checkstyle</span>, <span class="code">
          com.puppycrawl.tools.checkstyle.filters</span>, and <span class="code"> com.puppycrawl.tools.checkstyle.checks</span>
          and its sub-packages (only those included in the Checkstyle
          distribution). You can specify other packages in a <a href="#Packages"><em>package names XML document</em></a>
          when you invoke Checkstyle at the <a href="cmdline.html">command line</a>, and when you run a <a href="anttask.html">Checkstyle task</a> in ant.
        </li>

        <li>
          Apply the above rules to <span class="code">name</span>
          concatenated with <span class="code">"Check"</span>,
          such as loading class <span class="code">com.puppycrawl.tools.checkstyle.checks.ConstantNameCheck</span>
          for element
          <source>
&lt;module name="ConstantName"/&gt;
          </source>
        </li>
      </ol>
                                                      <a id="Properties"></a>
  <h2>Properties</h2>
                                    <p>
        Properties of a module control how the module performs its task.
        Each module property has a default value, and you are not
        required to define a property in the configuration document if
        the default value is satisfactory.  To assign a non-default
        value to a module's property, define a child <span class="code">property</span> element of the <span class="code">module</span> element in the configuration XML
        document. Also provide appropriate <span class="code">name</span> and <span class="code">value</span>
        attributes for the <span class="code">property</span> element.
        For example, property <span class="code">max</span> of module
        <span class="code">MethodLength</span> specifies the maximum
        allowable number of lines in a method or constructor, and has
        default value <span class="code">150</span>.  Here is a
        configuration of module <span class="code">MethodLength</span>
        so that the check reports methods and constructors with more
        than <span class="code">60</span> lines:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;MethodLength&quot;&gt;
    &lt;property name=&quot;max&quot; value=&quot;60&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        <a href="cmdline.html">Command line</a> properties and ant <a href="anttask.html">Checkstyle task</a> properties apply to the
        root <span class="code">Checker</span> module. Also, properties
        are inherited in the module hierarchy. These features make it
        easy to define one property value that applies to many
        modules. For example, the following configuration fragment
        specifies that a <span class="code">tabWidth</span> of <span class="code">4</span> applies to <span class="code">TreeWalker</span> and its submodules:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Checker&quot;&gt;
    &lt;module name=&quot;PackageHtml&quot;/&gt;
    &lt;module name=&quot;TreeWalker&quot;&gt;
        &lt;property name=&quot;tabWidth&quot; value=&quot;4&quot;/&gt;
        &lt;module name=&quot;AvoidStarImport&quot;/&gt;
        &lt;module name=&quot;ConstantName&quot;/&gt;
        ...
    &lt;/module&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        The value of a module property can be specified through
        <em>property expansion</em> with the <span class="code">${<em>property_name</em>}</span> notation, where
        <span class="code"><em>property_name</em></span> is a <a href="cmdline.html">command line</a> property or an ant <a href="anttask.html">Checkstyle task</a> property.  For example,
        the following configuration document element gives property
        <span class="code">headerFile</span> the value of command line
        property <span class="code">checkstyle.header.file</span>:
     </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;property name=&quot;headerFile&quot; value=&quot;${checkstyle.header.file}&quot;/&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        You can use property expansion to re-specify a module property
        value without changing the configuration document.
      </p>
                                                <p>
        The property element provides an optional <span class="code">default</span> attribute which is used when a
        property in the value cannot be resolved. For example this
        configuration snippet from a central configuration file checks
        that methods have javadoc, but allows inividual projects to
        override the severity by specifying their desired value in the
        command line property <span class="code">checkstyle.javadoc.severity</span>:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;JavaDocMethod&quot;&gt;
  &lt;property name=&quot;severity&quot;
               value=&quot;${checkstyle.javadoc.severity}&quot;
               default=&quot;error&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        This feature is a great help when setting up a centralized
        configuration file (e.g. one file for the whole company) to
        lower configuration maintenance costs.  Projects that are happy
        with the default can simply use that configuration file as is,
        but individual projects with special needs have the fexibility
        to adjust a few settings to fit their needs without having to
        copy and maintain the whole configuration.
      </p>
                                                      <a id="Checker"></a>
  <h2>Checker</h2>
                                    <p>
        All configurations have root module <span class="code">Checker</span>.  <span class="code">Checker</span>
        contains:
      </p>
                                                <ul>
        <li><em>FileSetCheck</em> children: modules that check sets of
        files.</li>
        <li><em>Filter</em> children: modules that filter audit
        events.</li>
        <li><em>AuditListener</em> children: modules that report
        filtered events.</li>
      </ul>
                                                <p>
        <span class="code">Checker</span> also defines properties that are
        inherited by all other modules of a configuration.
      </p>
                                                <h4 class="body">Properties</h4>
                                                <table>
                                            <tr class="even">
                        <th valign="top" align="left"
>
                name
        </th>
                                <th valign="top" align="left"
>
                description
        </th>
                                <th valign="top" align="left"
>
                type
        </th>
                                <th valign="top" align="left"
>
                default value
        </th>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                basedir
        </td>
                                <td class="odd"
>
                base directory name; stripped off in messages about files
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                localeCountry
        </td>
                                <td class="even"
>
                locale country for messages
        </td>
                                <td class="even"
>
                <a href="property_types.html#string">string</a>: either
          the empty string or an uppercase ISO 3166 2-letter code
        </td>
                                <td class="even"
>
                default locale country for the Java Virtual Machine
        </td>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                localeLanguage
        </td>
                                <td class="odd"
>
                locale language for messages
        </td>
                                <td class="odd"
>
                <a href="property_types.html#string">string</a>: either
          the empty string or a lowercase ISO 639 code
        </td>
                                <td class="odd"
>
                default locale language for the Java Virtual Machine
        </td>
            </tr>
            </table>
                                                <p>
        For example, the following configuration fragment specifies base
        directory <span class="code">src/checkstyle</span> and German
        locale for all modules:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Checker&quot;&gt;
    &lt;property name=&quot;basedir&quot; value=&quot;src/checkstyle&quot;/&gt;
    &lt;property name=&quot;localeCountry&quot; value=&quot;DE&quot;/&gt;
    &lt;property name=&quot;localeLanguage&quot; value=&quot;de&quot;/&gt;
    &lt;module name=&quot;PackageHtml&quot;/&gt;
    &lt;module name=&quot;TreeWalker&quot;&gt;
        ...
    &lt;/module&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                      <a id="TreeWalker"></a>
  <h2>TreeWalker</h2>
                                    <p>
        FileSetCheck <span class="code">TreeWalker</span> checks
        individual Java source files and defines properties that are
        applicable to checking such files.
      </p>
                                                <h4 class="body">Properties</h4>
                                                <table>
                                            <tr class="even">
                        <th valign="top" align="left"
>
                name
        </th>
                                <th valign="top" align="left"
>
                description
        </th>
                                <th valign="top" align="left"
>
                type
        </th>
                                <th valign="top" align="left"
>
                default value
        </th>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                cacheFile
        </td>
                                <td class="odd"
>
                caches information about files that have checked ok; used
          to avoid repeated checks of the same files
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                <span class="default">null</span> (no cache file)
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                tabWidth
        </td>
                                <td class="even"
>
                number of expanded spaces for a tab character (<span class="code">'\t'</span>); used in messages and Checks that
          require a tab width, such as <a href="config_sizes.html#LineLength"><span class="code">LineLength</span></a>
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                fileExtensions
        </td>
                                <td class="odd"
>
                file type extension to identify java files. Setting this
          property is typically only required if your java source code
          is preprocessed before compilation and the original files do
          not have the extension <span class="code">.java</span>
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                charset
        </td>
                                <td class="even"
>
                name of the file charset
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
                                <td class="even"
>
                System property "file.encoding"
        </td>
            </tr>
            </table>
                                                <p>
        For example, the following configuration fragment specifies
        <span class="code">TreeWalker</span> cache file <span class="code">target/cachefile</span>, and a <span class="code">tabWidth</span> of <span class="code">4</span>:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Checker&quot;&gt;
    &lt;module name=&quot;TreeWalker&quot;&gt;
        &lt;property name=&quot;cacheFile&quot; value=&quot;target/cachefile&quot;/&gt;
        &lt;property name=&quot;tabWidth&quot; value=&quot;4&quot;/&gt;
        ...
    &lt;/module&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To configure a <span class="code">TreeWalker</span> so that it
        handles files with the <span class="code">UTF-8</span> charset:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Checker&quot;&gt;
    &lt;module name=&quot;TreeWalker&quot;&gt;
        &lt;property name=&quot;charset&quot; value=&quot;UTF-8&quot;/&gt;
        ...
    &lt;/module&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        <!--
          thanks to Paul King for this example, see
          https://sourceforge.net/tracker/?func=detail&aid=865610&group_id=29721&atid=397078
        -->
        To integrate Checkstyle with BEA Weblogic Workshop 8.1:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Checker&quot;&gt;
    &lt;module name=&quot;TreeWalker&quot;&gt;
        &lt;property name=&quot;fileExtensions&quot; value=&quot;java,ejb,jpf&quot;/&gt;
        ...</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                      <a id="TreeWalker Checks"></a>
  <h2>TreeWalker Checks</h2>
                                    <p>
        The <span class="code">TreeWalker</span> module creates a syntax
        tree for a Java source file and invokes its submodules, called
        <em>Checks</em>, during a walk, or traversal, of the nodes of
        the tree.  Every node of the syntax tree has a token. A visit to
        a node during the traversal triggers all Checks that are
        configured for its token.  For example, if Check <span class="code">MethodLength</span> has been configured as a
        submodule of <span class="code">TreeWalker</span>, then a visit
        to a node with a method or a constructor definition token
        triggers <span class="code">MethodLength</span> to check the
        number of lines of the node's code block.
      </p>
                                                <p>
        Some Checks, such as <span class="code">FileLength</span> and
        <span class="code">LineLength</span>, apply directly to the
        source file and do not involve tokens of the syntax tree.  Other
        Checks are associated with configurable sets of tokens that
        trigger the Checks.  For example, this element configures Check
        <span class="code">MethodLength</span>:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;MethodLength&quot;/&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        The default token set for <span class="code">MethodLength</span>
        is <span class="code">{METHOD_DEF, CTOR_DEF}</span>, method
        definition and constructor definition tokens, so <span class="code">TreeWalker</span> invokes <span class="code">MethodLength</span> whenever it visits a node with
        a <span class="code">METHOD_DEF</span> or a <span class="code">CTOR_DEF</span> token.
      </p>
                                                <p>
        You specify the trigger tokens for a Check with property <span class="code">tokens</span>.  The value of <span class="code">tokens</span> is a list that denotes a subset of
        the Check's tokens, as in the following element that configures
        Check <span class="code">MethodLength</span> to check the number
        of lines of methods only:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;MethodLength&quot;&gt;
    &lt;property name=&quot;tokens&quot; value=&quot;METHOD_DEF&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To apply particular properties to different subsets of tokens
        for a Check, repeat the Check.  For example, to check that the
        length of each method is at most 150 lines (the default value of
        <span class="code">MethodLength</span> property <span class="code">max</span>) and the length of each constructor is
        at most 60 lines, include the following in the <span class="code">TreeWalker</span> configuration:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;MethodLength&quot;&gt;
    &lt;property name=&quot;tokens&quot; value=&quot;METHOD_DEF&quot;/&gt;
&lt;/module&gt;
        &lt;module name=&quot;MethodLength&quot;&gt;
    &lt;property name=&quot;tokens&quot; value=&quot;CTOR_DEF&quot;/&gt;
    &lt;property name=&quot;max&quot; value=&quot;60&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        Configurations of the Checks are specified in the pages under <a href="checks.html">here</a>.
      </p>
                                                      <a id="Severity"></a>
  <h2>Severity</h2>
                                    <p>
        Each check has a <a href="property_types.html#severity">severity</a> property that a
        Checkstyle audit assigns to all violations of the check. The
        default severity level of a check is <span class="default">error</span>.
      </p>
                                                <p>
        You can use the severity property to control the output of the
        plain formatter for the <a href="cmdline.html">command line
        tool</a> and the <a href="anttask.html">ANT task</a>. The plain
        formatter does not report violations with severity level <span class="default">ignore</span>, and notes violations with
        severity level <span class="default">warning</span>. For
        example, according to the following configuration fragment, the
        plain formatter outputs warnings for translation violations:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;Translation&quot;&gt;
    &lt;property name=&quot;severity&quot; value=&quot;warning&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        The XML formatter reports the severity level of every violation
        as an attribute of the violation's <span class="default">error</span> element.
      </p>
                                                      <a id="Filters"></a>
  <h2>Filters</h2>
                                    <p>
        A Checker module has a set of Filter submodules to filter audit
        events, including the error messages fired by Checks.  A Filter
        can accept or reject an audit event. If all Filters accept an
        audit event, then the Checker reports the event.  If any Filter
        rejects an event, then the Checker does not report the
        event.
      </p>
                                                        <h3>SeverityMatchFilter</h3>
                                    <p>
          Filter <span class="code">SeverityMatchFilter</span> decides
          audit events according to the <a href="#Severity">severity
          level</a> of the event.
	</p>
                                                <h5>SeverityMatchFilter Properties</h5>
                                                <table>
                                            <tr class="even">
                        <th valign="top" align="left"
>
                name
        </th>
                                <th valign="top" align="left"
>
                description
        </th>
                                <th valign="top" align="left"
>
                type
        </th>
                                <th valign="top" align="left"
>
                default value
        </th>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                severity
        </td>
                                <td class="odd"
>
                the severity level of this filter
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                acceptOnMatch
        </td>
                                <td class="even"
>
                
              If acceptOnMatch is <span class="code">true</span>, then
              the filter accepts an audit event if and only if there is
              a match between the event's severity level and property
              severity. If acceptOnMatch
              is <span class="code">false</span>, then the filter
              accepts an audit event if and only if there is not a match
              between the event's severity level and property severity.
            
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
            </tr>
            </table>
                                                <p>
          For example, the following configuration fragment directs the
          Checker to not report audit events with severity
          level <span class="code">info</span>:
	</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SeverityMatchFilter&quot;&gt;
    &lt;property name=&quot;severity&quot; value=&quot;info&quot;/&gt;
    &lt;property name=&quot;acceptOnMatch&quot; value=&quot;false&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                                            <h3>SuppressionFilter</h3>
                                    <p>
          Filter <span class="code">SuppressionFilter</span> rejects
          audit events for Check errors according to
          a <a href="#XML%20Details"><em>suppressions XML
          document</em></a> in a file. If there is no configured
          suppressions file, the Filter accepts all audit events.
	</p>
                                                <h5>SuppressionFilter Properties</h5>
                                                <table>
                                            <tr class="even">
                        <th valign="top" align="left"
>
                name
        </th>
                                <th valign="top" align="left"
>
                description
        </th>
                                <th valign="top" align="left"
>
                type
        </th>
                                <th valign="top" align="left"
>
                default value
        </th>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                file
        </td>
                                <td class="odd"
>
                the name of the <em>suppressions XML document</em> file
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
            </tr>
            </table>
                                                <p>
          For example, the following configuration fragment directs the
          Checker to use a <span class="code">SuppressionFilter</span>
          with suppressions
          file <span class="code">docs/suppressions.xml</span>:
	</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SuppressionFilter&quot;&gt;
    &lt;property name=&quot;file&quot; value=&quot;docs/suppressions.xml&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
          A <a href="#XML%20Details"><em>suppressions XML
          document</em></a> contains a set
          of <span class="code">suppress</span> elements, where
          each <span class="code">suppress</span> element can have the
          following attributes:
        </p>
                                                <ul>
   	  <li>
   	    <span class="code">files</span> -
   	    a <a href="property_types.html#regexp">regular expression</a>
   	    matched against the file name associated with an audit
   	    event. It is mandatory.
   	  </li>
   	  <li>
   	    <span class="code">checks</span> -
   	    a <a href="property_types.html#regexp">regular expression</a>
   	    matched against the name of the check associated with an audit
   	    event. Optional if <span class="code">id</span> is specified.
   	  </li>
   	  <li>
   	    <span class="code">id</span> -
   	    a <a href="property_types.html#string">string</a>
   	    matched against the id of the check associated with an audit
   	    event. Optional if <span class="code">checks</span> is specified.
   	  </li>
   	  <li>
   	    <span class="code">lines</span> - a comma-separated list of
   	    values, where each value is
   	    an <a href="property_types.html#integer">integer</a> or a
   	    range of integers denoted by integer-integer. It is optional.
   	  </li>
   	  <li>
   	    <span class="code">columns</span> - a comma-separated list of
   	    values, where each value is
   	    an <a href="property_types.html#integer">integer</a> or a
   	    range of integers denoted by integer-integer. It is optional.
   	  </li>
        </ul>
                                                <p>
	  Each audit event is checked against
	  each <span class="code">suppress</span> element. It is
	  suppressed if all specified attributes match against the audit
	  event.
	</p>
                                                <h5>Examples</h5>
                                                <p>
          For example, the following suppressions XML document directs
          a <span class="code">SuppressionFilter</span> to
          reject <span class="code">JavadocStyleCheck</span> errors for
          lines 82 and 108 to 122 of
          file <span class="code">AbstractComplexityCheck.java</span>,
          and <span class="code">MagicNumberCheck</span> errors for line
          221 of file <span class="code">JavadocStyleCheck.java</span>:
	</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;?xml version=&quot;1.0&quot;?&gt;

&lt;!DOCTYPE suppressions PUBLIC
    &quot;-//Puppy Crawl//DTD Suppressions 1.0//EN&quot;
    &quot;http://www.puppycrawl.com/dtds/suppressions_1_0.dtd&quot;&gt;

&lt;suppressions&gt;
    &lt;suppress checks=&quot;JavadocStyleCheck&quot;
              files=&quot;AbstractComplexityCheck.java&quot;
              lines=&quot;82,108-122&quot;/&gt;
    &lt;suppress checks=&quot;MagicNumberCheck&quot;
              files=&quot;JavadocStyleCheck.java&quot;
              lines=&quot;221&quot;/&gt;
&lt;/suppressions&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
	  As another example, imagine that a configuration contains the
	  following:
	</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;DescendantToken&quot;&gt;
    &lt;property name=&quot;id&quot; value=&quot;stringEqual&quot;/&gt;
    &lt;property name=&quot;tokens&quot; value=&quot;EQUAL,NOT_EQUAL&quot;/&gt;
    &lt;property name=&quot;limitedTokens&quot; value=&quot;STRING_LITERAL&quot;/&gt;
    &lt;property name=&quot;maximumNumber&quot; value=&quot;0&quot;/&gt;
    &lt;property name=&quot;maximumDepth&quot; value=&quot;1&quot;/&gt;
&lt;/module&gt;

&lt;module name=&quot;DescendantToken&quot;&gt;
    &lt;property name=&quot;id&quot; value=&quot;switchNoDefault&quot;/&gt;
    &lt;property name=&quot;tokens&quot; value=&quot;LITERAL_SWITCH&quot;/&gt;
    &lt;property name=&quot;maximumDepth&quot; value=&quot;2&quot;/&gt;
    &lt;property name=&quot;limitedTokens&quot; value=&quot;LITERAL_DEFAULT&quot;/&gt;
    &lt;property name=&quot;minimumNumber&quot; value=&quot;1&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
	  Then the following can be used to suppress only the first
	  check and not the second by using
	  the <span class="code">id</span> attribute:
	</p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;suppress id=&quot;stringEqual&quot; files=&quot;SomeTestCode.java&quot;/&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                                    <h4>SuppressionCommentFilter</h4>
                                                <p>
        Filter <span class="code">SuppressionCommentFilter</span> uses
        pairs of comments to suppress audit events.
      </p>
                                                <p>
        Rationale: Sometimes there are legitimate reasons for violating
        a check.  When this is a matter of the code in question and not
        personal preference, the best place to override the policy is in
        the code itself.  Semi-structured comments can be associated
        with the check.  This is sometimes superior to a separate
        suppressions file, which must be kept up-to-date as the source
        file is edited.
      </p>
                                                <p>
        Usage: This filter only works in conjunction with a <span class="code">FileContentsHolder</span>, since that check makes
        the suppression comments in the .java files available <i>sub
        rosa</i>. A configuration that includes this filter must
        configure <span class="code">FileContentsHolder</span> as a
        child module of <span class="code">TreeWalker</span>.
      </p>
                                                <h5>SuppressionCommentFilter Properties</h5>
                                                <table>
                                            <tr class="even">
                        <th valign="top" align="left"
>
                name
        </th>
                                <th valign="top" align="left"
>
                description
        </th>
                                <th valign="top" align="left"
>
                type
        </th>
                                <th valign="top" align="left"
>
                default value
        </th>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                offCommentFormat
        </td>
                                <td class="odd"
>
                comment pattern to trigger filter to begin suppression
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                onCommentFormat
        </td>
                                <td class="even"
>
                comment pattern to trigger filter to end suppression
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                checkFormat
        </td>
                                <td class="odd"
>
                check pattern to suppress
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                <span class="default">.*</span> (all checks)
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                messageFormat
        </td>
                                <td class="even"
>
                message pattern to suppress
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
                                <td class="even"
>
                none
        </td>
            </tr>
                                                <tr class="odd">
                        <td class="odd"
>
                checkCPP
        </td>
                                <td class="odd"
>
                whether to check C++ style comments (<code>//</code>)
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
                                <td class="odd"
>
                &nbsp;
        </td>
            </tr>
                                                <tr class="even">
                        <td class="even"
>
                checkC
        </td>
                                <td class="even"
>
                whether to check C style comments (<code>/* ... */</code>)
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
                                <td class="even"
>
                &nbsp;
        </td>
            </tr>
            </table>
                                                <h5>Restrictions</h5>
                                                <p>
        offCommentFormat and onCommentFormat must have equal <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html#groupCount()">paren counts</a>.
      </p>
                                                <h5>Examples</h5>
                                                <p>
        To configure the check that makes comments available to the filter:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;TreeWalker&quot;&gt;
    ...
    &lt;module name=&quot;FileContentsHolder&quot;/&gt;
    ...
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To configure a filter to suppress audit events between a comment
        containing <code>CHECKSTYLE:OFF</code> and a comment containing
        <code>CHECKSTYLE:ON</code>:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SuppressionCommentFilter&quot;/&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To configure a filter to suppress audit events between a comment
        containing line <code>BEGIN GENERATED CODE</code> and a comment
        containing line <code>END GENERATED CODE</code>:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SuppressionCommentFilter&quot;&gt;
    &lt;property name=&quot;offCommentFormat&quot; value=&quot;BEGIN GENERATED CODE&quot;/&gt;
    &lt;property name=&quot;onCommentFormat&quot; value=&quot;END GENERATED CODE&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To configure a filter so that <code>// stop constant
        check</code> and <code>// resume constant check</code> marks
        legitimate constant names:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SuppressionCommentFilter&quot;&gt;
    &lt;property name=&quot;offCommentFormat&quot; value=&quot;stop constant check&quot;/&gt;
    &lt;property name=&quot;onCommentFormat&quot; value=&quot;resume constant check&quot;/&gt;
    &lt;property name=&quot;checkFormat&quot; value=&quot;ConstantNameCheck&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To configure a filter so that <code>UNUSED OFF:
        <i>var</i></code> and <code>UNUSED ON: <i>var</i></code> marks a
        variable or parameter known not to be used by the code by
        matching the variable name in the message:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SuppressionCommentFilter&quot;&gt;
    &lt;property name=&quot;offCommentFormat&quot; value=&quot;UNUSED OFF\: (\w+)&quot;/&gt;
    &lt;property name=&quot;onCommentFormat&quot; value=&quot;UNUSED ON\: (\w+)&quot;/&gt;
    &lt;property name=&quot;checkFormat&quot; value=&quot;Unused&quot;/&gt;
    &lt;property name=&quot;messageFormat&quot; value=&quot;^Unused \w+ '$1'.$&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        To configure a filter so that <code>CSOFF: <i>regexp</i></code>
        and <code>CSN: <i>regexp</i></code> mark a matching check:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;SuppressionCommentFilter&quot;&gt;
    &lt;property name=&quot;offCommentFormat&quot; value=&quot;CSOFF\: ([\w\|]+)&quot;/&gt;
    &lt;property name=&quot;onCommentFormat&quot; value=&quot;CSON\: ([\w\|]+)&quot;/&gt;
    &lt;property name=&quot;checkFormat&quot; value=&quot;$1&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                      <a id="AuditListeners"></a>
  <h2>AuditListeners</h2>
                                    <p>
        In addition to an audit reporter for text or XML output, a
        Checker can have <a href="writinglisteners.html">custom
        AuditListeners</a> that handle audit events. In order to use a
        custom listener, add a <span>Checker</span> submodule for the
        listener and its properties.  For example, to configure a <span class="code">Checker</span> so that it uses custom listener <a href="writinglisteners.html#writing">VerboseListener</a> to
        print audit messages to a file named "audit.txt",
        include the following module in the configuration file:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;com.mycompany.listeners.VerboseListener&quot;&gt;
    &lt;property name=&quot;file&quot; value=&quot;audit.txt&quot;/&gt;
&lt;/module&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                      <a id="Packages"></a>
  <h2>Packages</h2>
                                    <p>
        Checkstyle loads a module class according to the <span class="code">name</span> of a <span class="code">module</span>
        element, and automatically appends pre-specified package
        prefixes to that <span class="code">name</span> in its search
        for a loadable class.  By default, Checkstyle applies packages
        <span class="code"> com.puppycrawl.tools.checkstyle</span>,
        <span class="code">
        com.puppycrawl.tools.checkstyle.filters</span>, and <span class="code"> com.puppycrawl.tools.checkstyle.checks</span> as
        well as any sub-packages of <span class="code">com.puppycrawl.tools.checkstyle.checks</span> that
        are distributed with Checkstyle. To specify other packages to
        apply, create a <em>package names XML document</em> in a file,
        and provide that file as a <a href="cmdline.html">command
        line</a> option or as a attribute of an <a href="anttask.html">ant Checkstyle task</a>.  This is useful for
        integrating other modules in your configuration.
      </p>
                                                <p>
        A <em>package names XML document</em> specifies a list of
        package names. Here is a sample package names XML document for
        packages <span class="code">
        com.puppycrawl.tools.checkstyle</span> and <span class="code">
        com.puppycrawl.tools.checkstyle.checks</span>:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;checkstyle-packages&gt;
  &lt;package name=&quot;com.puppycrawl.tools.checkstyle&quot;&gt;
    &lt;package name=&quot;checks&quot;/&gt;
  &lt;/package&gt;
&lt;/checkstyle-packages&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        Notice that the packages are specified recursively - a child
        <span class="code">package</span> element is a subpackage of its
        parent <span class="code">package</span> element.
      </p>
                                                <p>
        For example, to incorporate modules from package <span class="code">com.mycompany.checks</span> with Checkstyle
        modules, create the XML file below and specify that file as a <a href="cmdline.html">command line</a> option or as a attribute of
        an <a href="anttask.html">ant Checkstyle task</a>.:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

    &lt;!DOCTYPE checkstyle-packages PUBLIC
    &quot;-//Puppy Crawl//DTD Package Names 1.0//EN&quot;
    &quot;http://www.puppycrawl.com/dtds/packages_1_0.dtd&quot;&gt;

&lt;checkstyle-packages&gt;
  &lt;package name=&quot;com.mycompany.checks&quot;/&gt;
  &lt;package name=&quot;com.puppycrawl.tools.checkstyle&quot;&gt;
    &lt;package name=&quot;checks&quot;&gt;
      &lt;package name=&quot;blocks&quot;/&gt;
      &lt;package name=&quot;coding&quot;/&gt;
      &lt;package name=&quot;design&quot;/&gt;
      &lt;package name=&quot;imports&quot;/&gt;
      &lt;package name=&quot;indentation&quot;/&gt;
      &lt;package name=&quot;j2ee&quot;/&gt;
      &lt;package name=&quot;javadoc&quot;/&gt;
      &lt;package name=&quot;metrics&quot;/&gt;
      &lt;package name=&quot;naming&quot;/&gt;
      &lt;package name=&quot;sizes&quot;/&gt;
      &lt;package name=&quot;whitespace&quot;/&gt;
    &lt;/package&gt;
    &lt;package name=&quot;filters&quot;/&gt;
  &lt;/package&gt;
&lt;/checkstyle-packages&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        Now you can configure a module of package <span class="code">com.mycompany.checks</span>, say <span class="code">com.mycompany.checks.MethodLimitCheck</span>, with
        a shortened <span class="code">module</span> element in the
        configuration document:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;module name=&quot;MethodLimit&quot;/&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <div class="tip">
        <h4 class="tip">Important</h4>
        <p>
          If you provide a package names XML document for your own
          modules and still need to use Checkstyle modules, you must
          include <span class="code">package</span> elements for
          Checkstyle's packages.
        </p>
      </div>
                                                      <a id="XML Details"></a>
  <h2>XML Details</h2>
                                    <h4>Configuration XML Document</h4>
                                                <p>
        The following DTD for a configuration XML document specifies the
        hierarchy of modules and their properties:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;!ELEMENT module (module|property)*&gt;
&lt;!ATTLIST module name NMTOKEN #REQUIRED&gt;

&lt;!ELEMENT property EMPTY&gt;
&lt;!ATTLIST property
	name NMTOKEN #REQUIRED
	value CDATA #REQUIRED
&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        Checkstyle validates a configuration XML document when it loads
        the document.  To validate against the above configuration DTD,
        include the following document type declaration in your
        configuration XML document:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;!DOCTYPE module PUBLIC
&quot;-//Puppy Crawl//DTD Check Configuration 1.2//EN&quot;
&quot;http://www.puppycrawl.com/dtds/configuration_1_2.dtd&quot;&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        Checkstyle also strictly enforces the encoding attribute of an
        XML declaration.  If Checkstyle rejects your configuration
        document's encoding, correct the value of the encoding
        attribute, or remove the encoding attribute entirely.
      </p>
                                                <p>
        For a complete example of a configuration XML document, examine
        file <span class="code">docs/sun_checks.xml</span> that checks
        the Sun coding conventions.
      </p>
                                                <h4>Package Names XML Document</h4>
                                                <p>
        This is a DTD for a package names XML document:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;!ELEMENT checkstyle-packages (package)*&gt;

&lt;!ELEMENT package (package)*&gt;
&lt;!ATTLIST package name NMTOKEN #REQUIRED&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <p>
        Checkstyle also validates a package names XML document when it
        loads the document.  To validate against the above package names
        DTD, include the following document type declaration in your
        package names XML document:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;!DOCTYPE checkstyle-packages PUBLIC
&quot;-//Puppy Crawl//DTD Package Names 1.1//EN&quot;
&quot;http://www.puppycrawl.com/dtds/packages_1_1.dtd&quot;&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                                <h4>Suppressions XML Document</h4>
                                                <p>
        This is a DTD for a suppressions XML document:
      </p>
                                                    <div align="left">
    <table cellspacing="4" cellpadding="0" border="0">
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#ffffff"><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;!ELEMENT suppressions (suppress*)&gt;

&lt;!ELEMENT suppress EMPTY&gt;
&lt;!ATTLIST suppress files CDATA #REQUIRED
                   checks CDATA #IMPLIED
                   id CDATA #IMPLIED
                   lines CDATA #IMPLIED
                   columns CDATA #IMPLIED&gt;</pre></td>
      <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    <tr>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
      <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
    </tr>
    </table>
    </div>
                                        </div>
    </div>

    <div class="csBottomBar">
      <div class="csBottomBarContents">
        Copyright &copy; 2001-2007, Oliver Burn
      </div>
    </div>
  </body>
</html>

<!-- end the processing -->