From 22d78fa990f7007dfd40802ad4410304970d55cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20K=C3=BChne?= Date: Mon, 12 Apr 2004 11:32:47 +0000 Subject: [PATCH] copyright year 2004 --- docs/anttask.html | 2 +- docs/cmdline.html | 4 +- docs/config.html | 2 +- docs/config_blocks.html | 4 +- docs/config_coding.html | 2 +- docs/config_design.html | 2 +- docs/config_duplicates.html | 2 +- docs/config_header.html | 20 ++--- docs/config_import.html | 28 +++---- docs/config_j2ee.html | 34 ++++----- docs/config_javadoc.html | 6 +- docs/config_metrics.html | 12 +-- docs/config_misc.html | 34 ++++----- docs/config_modifiers.html | 2 +- docs/config_naming.html | 26 +++---- docs/config_reporting.html | 2 +- docs/config_sizes.html | 26 +++---- docs/config_usage.html | 4 +- docs/config_whitespace.html | 38 ++++----- docs/contributing.html | 2 +- docs/index.html | 4 +- docs/optional.html | 4 +- docs/property_types.html | 2 +- docs/releasenotes.html | 2 +- docs/writingchecks.html | 2 +- docs/writingfilters.html | 28 +++---- docs/writinglisteners.html | 148 ++++++++++++++++++------------------ 27 files changed, 221 insertions(+), 221 deletions(-) diff --git a/docs/anttask.html b/docs/anttask.html index 9242b58a5..d2721dccb 100644 --- a/docs/anttask.html +++ b/docs/anttask.html @@ -271,6 +271,6 @@ provide a package names file
- + diff --git a/docs/cmdline.html b/docs/cmdline.html index 5ee18e2dc..da6e5f359 100644 --- a/docs/cmdline.html +++ b/docs/cmdline.html @@ -144,7 +144,7 @@ provide a package names file

Tip

- It is possible to run Checkstyle directly from the JAR file using the + It is possible to run Checkstyle directly from the JAR file using the -jar option. An example would be:

@@ -156,6 +156,6 @@ provide a package names file
Back to the Checkstyle Home Page
- + diff --git a/docs/config.html b/docs/config.html index fb95b8988..0406d9f5a 100644 --- a/docs/config.html +++ b/docs/config.html @@ -826,7 +826,7 @@
Back to the Checkstyle Home Page
diff --git a/docs/config_blocks.html b/docs/config_blocks.html index 847795cec..ba28c3b94 100644 --- a/docs/config_blocks.html +++ b/docs/config_blocks.html @@ -259,7 +259,7 @@

RightCurly

Description

Checks the placement of right curly braces ('}') for - else, try, and catch + else, try, and catch tokens. The policy to verify is specified using property option.

@@ -430,7 +430,7 @@ switch (a)
Back to the Checkstyle Home Page
diff --git a/docs/config_coding.html b/docs/config_coding.html index 67a10c6fb..59c619663 100644 --- a/docs/config_coding.html +++ b/docs/config_coding.html @@ -1620,7 +1620,7 @@ return !valid();
Back to the Checkstyle Home Page
diff --git a/docs/config_design.html b/docs/config_design.html index b3c339d90..4540fc64d 100644 --- a/docs/config_design.html +++ b/docs/config_design.html @@ -408,7 +408,7 @@ public class StringUtils // not final to allow subclassing
Back to the Checkstyle Home Page
diff --git a/docs/config_duplicates.html b/docs/config_duplicates.html index 17474f240..d9f4279ba 100644 --- a/docs/config_duplicates.html +++ b/docs/config_duplicates.html @@ -141,7 +141,7 @@ Checkstyle plugins for duplicate code detection:
Back to the Checkstyle Home Page
diff --git a/docs/config_header.html b/docs/config_header.html index 81413694c..3ef89759f 100644 --- a/docs/config_header.html +++ b/docs/config_header.html @@ -39,9 +39,9 @@ headerFile specifies a file that contains the required header.

- Property ignoreLines specifies the line numbers to - ignore when matching lines in a header file. This property is very useful for - supporting headers that contain copyright dates. For example, consider the + Property ignoreLines specifies the line numbers to + ignore when matching lines in a header file. This property is very useful for + supporting headers that contain copyright dates. For example, consider the following header:

@@ -52,7 +52,7 @@ line 4: // Copyright (C) 2002  Oliver Burn
 line 5: ////////////////////////////////////////////////////////////////////
       

- Since the year information will change over time, you can tell Checkstyle to + Since the year information will change over time, you can tell Checkstyle to ignore line 4 by setting property ignoreLines to 4.

@@ -80,7 +80,7 @@ line 5: ////////////////////////////////////////////////////////////////////

Example

- To configure the check to use header file "java.header" + To configure the check to use header file "java.header" and ignore lines 2, 3, and 4:

@@ -100,12 +100,12 @@ line 5: ////////////////////////////////////////////////////////////////////

RegexpHeader

Description

- Checks the header of a source file against a header file that contains a regular + Checks the header of a source file against a header file that contains a regular expression for each line of the source header.

- Rationale: In some projects checking against a fixed header - is not sufficient, e.g. the header might require a copyright line where the year + Rationale: In some projects checking against a fixed header + is not sufficient, e.g. the header might require a copyright line where the year information is not static.

@@ -118,7 +118,7 @@ line 3: ^// Checks Java source code for adherence to a set of rules\.$ line 4: ^// Copyright \(C\) \d\d\d\d Oliver Burn$ line 5: ^// Last modification by \$Author.*\$$ line 6: ^/{71}$ -line 7: +line 7: line 8: ^package line 9: line 10: ^import @@ -190,7 +190,7 @@ line 14: ^ \*/


Back to the Checkstyle Home Page
diff --git a/docs/config_import.html b/docs/config_import.html index f67249a4a..e2b37b67c 100644 --- a/docs/config_import.html +++ b/docs/config_import.html @@ -91,9 +91,9 @@

Description

- Checks for imports from a set of illegal packages. By default, the check rejects - all sun.* packages since programs that contain direct - calls to the sun.* packages are not + Checks for imports from a set of illegal packages. By default, the check rejects + all sun.* packages since programs that contain direct + calls to the sun.* packages are not 100% Pure Java. To reject other packages, set property illegalPkgs to a list of the illegal packages.

@@ -121,7 +121,7 @@ <module name="IllegalImport"/>

- To configure the check so that it rejects packages java.io.* + To configure the check so that it rejects packages java.io.* and java.sql.*:

@@ -139,16 +139,16 @@
       

RedundantImport

Description

- Checks for redundant import statements. An import statement is considered + Checks for redundant import statements. An import statement is considered redundant if:

  • - It is a duplicate of another import. This is, when a class is imported more than + It is a duplicate of another import. This is, when a class is imported more than once.
  • - The class imported is from the java.lang package, e.g. + The class imported is from the java.lang package, e.g. importing java.lang.String.
  • @@ -173,25 +173,25 @@

    UnusedImports

    Description

    - Checks for unused import statements. Checkstyle uses a simple but very reliable - algorithm to report on unused import statements. An import statement is + Checks for unused import statements. Checkstyle uses a simple but very reliable + algorithm to report on unused import statements. An import statement is considered unused if:

    • - It is not referenced in the file. The algorithm does not support wild-card - imports like import java.io.*;. Most IDE's provide + It is not referenced in the file. The algorithm does not support wild-card + imports like import java.io.*;. Most IDE's provide very sophisticated checks for imports that handle wild-card imports.
    • - It is a duplicate of another import. This is when a class is imported more than + It is a duplicate of another import. This is when a class is imported more than once.
    • - The class imported is from the java.lang package. For + The class imported is from the java.lang package. For example importing java.lang.String.
    • @@ -288,7 +288,7 @@
      diff --git a/docs/config_j2ee.html b/docs/config_j2ee.html index d870d3ed8..51bab748f 100644 --- a/docs/config_j2ee.html +++ b/docs/config_j2ee.html @@ -86,8 +86,8 @@ static.
    • - The return type of all ejbCreate<METHOD>(...) - methods is not void, because the return type must be + The return type of all ejbCreate<METHOD>(...) + methods is not void, because the return type must be the entity bean's primary key type.
    • @@ -96,11 +96,11 @@ static.
    • - The return type of all ejbPostCreate<METHOD>(...) + The return type of all ejbPostCreate<METHOD>(...) methods is void.
    • - For each ejbCreate<METHOD>(...) method there is + For each ejbCreate<METHOD>(...) method there is a matching ejbPostCreate<METHOD>(...) method.
    • @@ -109,7 +109,7 @@ public, and not static.
    • - The throws clause of all ejbHome<METHOD>(...) + The throws clause of all ejbHome<METHOD>(...) methods does not define the java.rmi.RemoteException.
    @@ -125,8 +125,8 @@ static.
  • - The return type of all ejbFind<METHOD>(...) - methods is not void, because the return type must be + The return type of all ejbFind<METHOD>(...) + methods is not void, because the return type must be the entity bean's primary key type, or a collection of primary keys.
  • @@ -139,7 +139,7 @@

    • - The throws clause of all ejbCreate<METHOD>(...) + The throws clause of all ejbCreate<METHOD>(...) methods defines the javax.ejb.CreateException.
    • @@ -147,7 +147,7 @@ public and abstract.
    • - The throws clause of all ejbSelect<METHOD>(...) + The throws clause of all ejbSelect<METHOD>(...) methods defines the javax.ejb.FinderException.
    @@ -169,7 +169,7 @@

    - Reference: Enterprise JavaBeans™ Specification,Version 2.0, sections + Reference: Enterprise JavaBeans™ Specification,Version 2.0, sections 10.6 and 12.2.

    Example

    @@ -230,12 +230,12 @@

    • - The return type of all create<METHOD>(...) - methods is not void, because the return type must be + The return type of all create<METHOD>(...) + methods is not void, because the return type must be the bean's local interface.
    • - The throws clause of all create<METHOD>(...) + The throws clause of all create<METHOD>(...) methods defines the javax.ejb.CreateException.
    • The throws clause of all methods does not define the java.rmi.RemoteException.
    • @@ -342,12 +342,12 @@

      • - The return type of all create<METHOD>(...) - methods is not void, because the return type must be + The return type of all create<METHOD>(...) + methods is not void, because the return type must be the bean's remote interface.
      • - The throws clause of all create<METHOD>(...) + The throws clause of all create<METHOD>(...) methods defines the javax.ejb.CreateException.
      • The throws clause of all methods defines the java.rmi.RemoteException.
      • @@ -504,7 +504,7 @@
        diff --git a/docs/config_javadoc.html b/docs/config_javadoc.html index c9bc44075..5889d5940 100644 --- a/docs/config_javadoc.html +++ b/docs/config_javadoc.html @@ -515,7 +515,7 @@ convention of using a tokens definitions to check - + subset of tokens INTERFACE_DEF, CLASS_DEF, @@ -530,7 +530,7 @@ convention of using a CTOR_DEF, VARIABLE_DEF - + @@ -590,7 +590,7 @@ convention of using a
        diff --git a/docs/config_metrics.html b/docs/config_metrics.html index acff492a7..a0fa5e711 100644 --- a/docs/config_metrics.html +++ b/docs/config_metrics.html @@ -79,7 +79,7 @@ <module name="BooleanExpressionComplexity"> <property name="max" value="7"/> </module> - +

Package

@@ -139,7 +139,7 @@ <module name="ClassDataAbstractionCoupling"> <property name="max" value="5"/> </module> - +

Package

@@ -193,7 +193,7 @@ <module name="ClassFanOutComplexity"> <property name="max" value="10"/> </module> - +

Package

@@ -258,7 +258,7 @@ considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now! <module name="CyclomaticComplexity"> <property name="max" value="7"/> </module> - +

Package

@@ -320,7 +320,7 @@ considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now! <module name="NPathComplexity"> <property name="max" value="20"/> </module> - +

Package

@@ -339,7 +339,7 @@ considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now!
Back to the Checkstyle Home Page
diff --git a/docs/config_misc.html b/docs/config_misc.html index 64e2c8010..90d62430d 100644 --- a/docs/config_misc.html +++ b/docs/config_misc.html @@ -62,11 +62,11 @@

GenericIllegalRegexp

Description

- A generic check for code problems - the user can search for any pattern. This is + A generic check for code problems - the user can search for any pattern. This is similar to a recursive grep, only that it's integrated in checkstyle.

- Rationale: This check can be used to prototype checks and to find common bad + Rationale: This check can be used to prototype checks and to find common bad practice such as calling ex.printStacktrace(), System.out.println(), System.exit(), etc.

@@ -98,7 +98,7 @@ message - message which is used to notify about violations, + message which is used to notify about violations, if empty then default(hard-coded) message is used. String ""(empty) @@ -190,8 +190,8 @@

TodoComment

Description

- A check for TODO: comments. Actually it is a generic regular - expression matcher on Java comments. To check for other patterns in Java + A check for TODO: comments. Actually it is a generic regular + expression matcher on Java comments. To check for other patterns in Java comments, set property format.

Properties

@@ -211,8 +211,8 @@

Notes

- Using TODO: comments is a great way to keep track of - tasks that need to be done. Having them reported by Checkstyle makes it very + Using TODO: comments is a great way to keep track of + tasks that need to be done. Having them reported by Checkstyle makes it very hard to forget about them.

Examples

@@ -347,30 +347,30 @@

Package

com.puppycrawl.tools.checkstyle.checks - +

Parent Module

TreeWalker - +

UpperEll

Description

- Checks that long constants are defined with an upper ell. That is ' + Checks that long constants are defined with an upper ell. That is ' L' and -not 'l'. This is in accordance to the Java Language -Specification, +not 'l'. This is in accordance to the Java Language +Specification, Section 3.10.1.

-

Rationale: The letter l looks a lot +

Rationale: The letter l looks a lot like 1.

Examples

To configure the check: - +

 <module name="UpperEll"/>
@@ -378,12 +378,12 @@ like 1.
       

Package

com.puppycrawl.tools.checkstyle.checks - +

Parent Module

TreeWalker - +

ArrayTypeStyle

Description

@@ -880,7 +880,7 @@ like 1.
Back to the Checkstyle Home Page
diff --git a/docs/config_modifiers.html b/docs/config_modifiers.html index be0da9b5b..2d29a6613 100644 --- a/docs/config_modifiers.html +++ b/docs/config_modifiers.html @@ -177,7 +177,7 @@ Language specification, section 9.3).
Back to the Checkstyle Home Page
diff --git a/docs/config_naming.html b/docs/config_naming.html index 4d0359d7b..2757cb834 100644 --- a/docs/config_naming.html +++ b/docs/config_naming.html @@ -19,9 +19,9 @@

Overview

- Each of these naming modules validates identifiers for particular code elements. Valid - identifiers for a naming module are specified by its - format property. The value of format is a regular + Each of these naming modules validates identifiers for particular code elements. Valid + identifiers for a naming module are specified by its + format property. The value of format is a regular expression for valid identifiers. This is an example of a configuration of the MemberName module to ensure that member identifiers begin with 'm', @@ -52,7 +52,7 @@ ConstantName - constants (static, + constants (static, final fields) ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ @@ -103,10 +103,10 @@

  • The default value of format for - module PackageName has - been chosen to match the requirements in the Java - Language specification and the Sun coding conventions. However both - underscores and uppercase letters are rather uncommon, so most configurations should + module PackageName has + been chosen to match the requirements in the Java + Language specification and the Sun coding conventions. However both + underscores and uppercase letters are rather uncommon, so most configurations should probably assign value ^[a-z]+(\.[a-z][a-z0-9]*)*$ to format for module PackageName, as in @@ -121,10 +121,10 @@ which can be used to control whether the check applies to variable declarations or catch clause parameters through tokens - VARIABLE_DEF and PARAMETER_DEF. + VARIABLE_DEF and PARAMETER_DEF. For example, the following configuration element ensures that catch clause parameters begin with "e", - followed by letters and digits: + followed by letters and digits:
             <module name="LocalVariableName">
                 <property name="format" value="^e[a-zA-Z0-9]*$"/>
    @@ -136,9 +136,9 @@
                 Module TypeName also has property tokens
                 which can be used to control whether the check applies to classes or interfaces through
                 tokens
    -            CLASS_DEF and INTERFACE_DEF. 
    +            CLASS_DEF and INTERFACE_DEF.
                 For example, the following configuration element ensures that
    -            interface names begin with "I_", followed by letters and digits: 
    +            interface names begin with "I_", followed by letters and digits:
                 
             <module name="TypeName">
                 <property name="format" value="^I_[a-zA-Z0-9]*$"/>
    @@ -185,7 +185,7 @@
     
    diff --git a/docs/config_reporting.html b/docs/config_reporting.html index 0da430ba9..19271fe27 100644 --- a/docs/config_reporting.html +++ b/docs/config_reporting.html @@ -51,7 +51,7 @@ type is string and defaults to an empty string.


    - + diff --git a/docs/config_sizes.html b/docs/config_sizes.html index fddfada67..ab3dd367e 100644 --- a/docs/config_sizes.html +++ b/docs/config_sizes.html @@ -104,7 +104,7 @@ <property name="max" value="20"/> <property name="tokens" value="CTOR_DEF,METHOD_DEF"/> </module> - +

    Package

    @@ -123,8 +123,8 @@ Checks for long source files.

    - Rationale: If a source file becomes very long it is hard to understand. - Therefore long classes should usually be refactored into several individual + Rationale: If a source file becomes very long it is hard to understand. + Therefore long classes should usually be refactored into several individual classes that focus on a specific task.

    @@ -169,8 +169,8 @@ Checks for long lines.

    - Rationale: Long lines are hard to read in printouts or if developers have - limited screen space for the source code, e.g. if the IDE displays additional + Rationale: Long lines are hard to read in printouts or if developers have + limited screen space for the source code, e.g. if the IDE displays additional information like project tree, class hierarchy, etc.

    @@ -207,7 +207,7 @@ </module>

    - To configure the check to ignore lines that begin with " * ", followed + To configure the check to ignore lines that begin with " * ", followed by just one word, such as within a Javadoc comment:

    @@ -219,18 +219,18 @@
           

    Notes

    • - The calculation of the length of a line takes into account the number of expanded spaces + The calculation of the length of a line takes into account the number of expanded spaces for a tab character ('\t'). The default number of spaces is 8. - To specify a different number of spaces, the user can + To specify a different number of spaces, the user can set TreeWalker property tabWidth which applies to all Checks, including LineLength; or can set property tabWidth for LineLength alone.
    • -
    • Support for the special handling of imports in CheckStyle Version 2 has been +
    • Support for the special handling of imports in CheckStyle Version 2 has been dropped as it is a special case of regexp: The user can set property - ignorePattern to + ignorePattern to ^import and achieve the same effect.
    @@ -250,8 +250,8 @@ Checks for long methods and constructors.

    - Rationale: If a method becomes very long it is hard to understand. Therefore - long methods should usually be refactored into several individual methods that + Rationale: If a method becomes very long it is hard to understand. Therefore + long methods should usually be refactored into several individual methods that focus on a specific task.

    @@ -448,7 +448,7 @@
    diff --git a/docs/config_usage.html b/docs/config_usage.html index 5e127e69b..cacde963a 100644 --- a/docs/config_usage.html +++ b/docs/config_usage.html @@ -41,7 +41,7 @@ - +

    OneMethodPrivateField

    Description

    @@ -321,7 +321,7 @@


    diff --git a/docs/config_whitespace.html b/docs/config_whitespace.html index 0535a1735..fc630c108 100644 --- a/docs/config_whitespace.html +++ b/docs/config_whitespace.html @@ -59,7 +59,7 @@ - +

    EmptyForInitializerPad

    Description

    @@ -177,8 +177,8 @@ for (Iterator foo = very.long.line.iterator(); That is, if the identifier and left parenthesis are on the same line, checks whether a space is required immediately after the identifier or such a space is forbidden. - If they are not on the same line, reports an error, unless configured to allow line breaks. - To allow linebreaks after the identifier, + If they are not on the same line, reports an error, unless configured to allow line breaks. + To allow linebreaks after the identifier, set property allowLineBreaks to true.

    @@ -260,9 +260,9 @@ for (Iterator foo = very.long.line.iterator();

    Description

    - Checks that there is no whitespace after a token. More specifically, it checks - that it is not followed by whitespace, or (if linebreaks are allowed) all - characters on the line after are whitespace. To forbid linebreaks after a token, + Checks that there is no whitespace after a token. More specifically, it checks + that it is not followed by whitespace, or (if linebreaks are allowed) all + characters on the line after are whitespace. To forbid linebreaks after a token, set property allowLineBreaks to false.

    @@ -349,9 +349,9 @@ for (Iterator foo = very.long.line.iterator();

    NoWhitespaceBefore

    Description

    - Checks that there is no whitespace before a token. More specifically, it checks - that it is not preceded with whitespace, or (if linebreaks are allowed) all - characters on the line before are whitespace. To allow linebreaks before a token, + Checks that there is no whitespace before a token. More specifically, it checks + that it is not preceded with whitespace, or (if linebreaks are allowed) all + characters on the line before are whitespace. To allow linebreaks before a token, set property allowLineBreaks to true.

    @@ -566,7 +566,7 @@ for (Iterator foo = very.long.line.iterator(); <module name="OperatorWrap"/>

    - To configure the check for the assignment operator, =, + To configure the check for the assignment operator, =, at the end of a line:

    @@ -589,8 +589,8 @@ for (Iterator foo = very.long.line.iterator();
            

    ParenPad

    Description

    - Checks the policy on the padding of parentheses; i.e. whether a space is - required after a left parenthesis and before a right parenthesis, or such spaces + Checks the policy on the padding of parentheses; i.e. whether a space is + required after a left parenthesis and before a right parenthesis, or such spaces are forbidden.

    Properties

    @@ -644,7 +644,7 @@ for (Iterator foo = very.long.line.iterator(); <module name="ParenPad"/>

    - To configure the check to require spaces for the parentheses of constructor, + To configure the check to require spaces for the parentheses of constructor, method, and super constructor calls:

    @@ -672,7 +672,7 @@ for (Iterator foo = very.long.line.iterator();
           

    Checks the policy on the padding of parentheses for typecasts. That is, whether a space is required after a left parenthesis and before a right parenthesis, or such spaces are forbidden.

    - +

    Properties

    @@ -734,7 +734,7 @@ for (Iterator foo = very.long.line.iterator();

    TabCharacter

    Description

    - Checks that there are no tab characters ('\t') in the + Checks that there are no tab characters ('\t') in the source code.

    @@ -742,12 +742,12 @@ for (Iterator foo = very.long.line.iterator();

    • - Developers should not need to configure the tab width of their text editors in + Developers should not need to configure the tab width of their text editors in order to be able to read source code.
    • - From the Apache jakarta coding standards: In a distributed development - environment, when the cvs commit messages get sent to a mailing list, they are + From the Apache jakarta coding standards: In a distributed development + environment, when the cvs commit messages get sent to a mailing list, they are almost impossible to read if you use tabs.
    @@ -973,7 +973,7 @@ for (Iterator foo = very.long.line.iterator();
    diff --git a/docs/contributing.html b/docs/contributing.html index d4dab3259..3f98a2df7 100644 --- a/docs/contributing.html +++ b/docs/contributing.html @@ -132,5 +132,5 @@

    - + diff --git a/docs/index.html b/docs/index.html index a3cc2daaf..4ab7b0945 100644 --- a/docs/index.html +++ b/docs/index.html @@ -209,7 +209,7 @@ href="http://www.intellij.org/twiki/bin/view/Main/JetStylePlugin">http://www.int Checkstyle with Borland JBuilder. It is available via the JBCS + href="http://sourceforge.net/projects/jbcheckstyle-pg/">JBCS Sourceforge Project Page.
  • @@ -248,6 +248,6 @@ also available.
    - + diff --git a/docs/optional.html b/docs/optional.html index 6302cc82b..512920526 100644 --- a/docs/optional.html +++ b/docs/optional.html @@ -57,7 +57,7 @@ names such as UnusedLocalVariable. Optional checks are distributed in jar file checkstyle-optional-@CHECKSTYLE_VERSION@.jar and, in order to use an optional check, this jar file must be in the classpath. -For example, this is a command to run Checkstyle with a configuration +For example, this is a command to run Checkstyle with a configuration that contains optional checks:

    @@ -72,6 +72,6 @@ Please consult Command Line and
     
     
    - + diff --git a/docs/property_types.html b/docs/property_types.html index 955bfcc93..75aee252f 100644 --- a/docs/property_types.html +++ b/docs/property_types.html @@ -294,7 +294,7 @@ or mixed persistence:


    - + diff --git a/docs/releasenotes.html b/docs/releasenotes.html index efc29389d..ad1bb563a 100644 --- a/docs/releasenotes.html +++ b/docs/releasenotes.html @@ -981,5 +981,5 @@
    - + diff --git a/docs/writingchecks.html b/docs/writingchecks.html index 4ad3a2074..c45407045 100644 --- a/docs/writingchecks.html +++ b/docs/writingchecks.html @@ -588,5 +588,5 @@
    - + diff --git a/docs/writingfilters.html b/docs/writingfilters.html index 746a5352e..f39ed128a 100644 --- a/docs/writingfilters.html +++ b/docs/writingfilters.html @@ -55,10 +55,10 @@ A FilterSet is a particular Filter that contains a set of Filters. A FilterSet accepts an AuditEvent if and only if - all Filters in the set accept the AuditEvent. + all Filters in the set accept the AuditEvent.

    - Here is a UML diagram for interface Filter + Here is a UML diagram for interface Filter and class FilterSet.

    Filter UML diagram @@ -98,7 +98,7 @@ public class FilesFilter { setFiles("^$"); } - + public boolean accept(AuditEvent aEvent) { final String fileName = aEvent.getFileName(); @@ -117,13 +117,13 @@ public class FilesFilter

    To incorporate a Filter in the filter set for a Checker, include a module element for the Filter in the - configuration file. For example, to configure a Checker + configuration file. For example, to configure a Checker so that it uses custom filter FilesFilter to prevent reporting of audit events for files whose name contains "Generated", include the following module in the configuration file:

    -
         
    +      
         <module name="com.mycompany.filters.FilesFilter">
             <property name="files" value="Generated"/>
         </module>
    @@ -131,12 +131,12 @@ public class FilesFilter
     
            

    Huh? I can't figure it out!

    - That's probably our fault, and it means that we have to provide better - documentation. Please do not hesitate to ask questions on the user mailing list, - this will help us to improve this document. Please ask your questions as - precisely as possible. We will not be able to answer questions like "I want - to write a filter but I don't know how, can you help me?". Tell us - what you are trying to do (the purpose of the filter), what you have + That's probably our fault, and it means that we have to provide better + documentation. Please do not hesitate to ask questions on the user mailing list, + this will help us to improve this document. Please ask your questions as + precisely as possible. We will not be able to answer questions like "I want + to write a filter but I don't know how, can you help me?". Tell us + what you are trying to do (the purpose of the filter), what you have understood so far, and what exactly you are getting stuck on.

    @@ -144,8 +144,8 @@ public class FilesFilter

    We need your help to keep improving Checkstyle. - Whenever you write a filter that you think is generally useful, please - consider contributing it to the Checkstyle + Whenever you write a filter that you think is generally useful, please + consider contributing it to the Checkstyle community and submit it for inclusion in the next release of Checkstyle.

    @@ -158,7 +158,7 @@ public class FilesFilter Back to the Checkstyle Home Page
diff --git a/docs/writinglisteners.html b/docs/writinglisteners.html index 92477622f..94653eab3 100644 --- a/docs/writinglisteners.html +++ b/docs/writinglisteners.html @@ -51,42 +51,42 @@

Overview

- A Checkstyle listener monitors the progress of a Checker - during the audit of files. The Checker notifies its - attached listeners of significant events such as the start of the audit of a - file and the logging of a Check error, and the listeners respond appropriately. + A Checkstyle listener monitors the progress of a Checker + during the audit of files. The Checker notifies its + attached listeners of significant events such as the start of the audit of a + file and the logging of a Check error, and the listeners respond appropriately. Any number of listeners can be attached to a - Checker. An audit always adds one of the distribution listeners, DefaultLogger - or XMLLogger, - to report events. A DefaultLogger produces simple text - output for the events it receives, and a XMLLogger + Checker. An audit always adds one of the distribution listeners, DefaultLogger + or XMLLogger, + to report events. A DefaultLogger produces simple text + output for the events it receives, and a XMLLogger produces an XML document for its events.

Listeners DefaultLogger and - XMLLogger are sufficient for most Checkstyle users, but you may find a - need for a custom listener. For example, a user has requested verbose output of - progress information during a Checkstyle run. Another user would like to filter - error events. This document explains how to write listeners for such tasks and - how to integrate them in a Checker module. It also describes two custom - listeners that are inspired by ANT listeners: a listener that is a wrapper for + XMLLogger are sufficient for most Checkstyle users, but you may find a + need for a custom listener. For example, a user has requested verbose output of + progress information during a Checkstyle run. Another user would like to filter + error events. This document explains how to write listeners for such tasks and + how to integrate them in a Checker module. It also describes two custom + listeners that are inspired by ANT listeners: a listener that is a wrapper for the Jakarta Commons Logging API, and a listener that sends its results via email.

- A listener is an implementation of the AuditListener - interface. During an audit, a Checker informs its - attached AuditListeners of six kinds of events: audit + A listener is an implementation of the AuditListener + interface. During an audit, a Checker informs its + attached AuditListeners of six kinds of events: audit started/ended, file started/ended, and logging of an error/exception.

- An audit passes an event to a listener as an AuditEvent. - A file-related AuditEvent contains the name of that - file. An AuditEvent for error logging has a message, a - severity level, a message source such as the name of a Check, - and file line and column numbers that may be relevant to the error. The - notification of an exception to a AuditListener - includes an error AuditEvent and the details of the - exception. Here is a UML diagram for classes AuditListener + An audit passes an event to a listener as an AuditEvent. + A file-related AuditEvent contains the name of that + file. An AuditEvent for error logging has a message, a + severity level, a message source such as the name of a Check, + and file line and column numbers that may be relevant to the error. The + notification of an exception to a AuditListener + includes an error AuditEvent and the details of the + exception. Here is a UML diagram for classes AuditListener and AuditEvent.

AuditListener UML diagram @@ -94,17 +94,17 @@

Writing Listeners

- A custom listener is an implementation of the AuditListener + A custom listener is an implementation of the AuditListener interface. If the listener has properties that can be set from a configuration, the listener must extend AutomaticBean. An AutomaticBean uses JavaBean introspection to set JavaBean properties.

- The custom listener that we demonstrate here is a verbose listener that simply - prints each event notification to an output stream, and reports the number of + The custom listener that we demonstrate here is a verbose listener that simply + prints each event notification to an output stream, and reports the number of errors per audited file and the total number of errors. The default output stream is System.out. In order to enable the specification of output to a file - through property file, + through property file, the class extends AutomaticBean and defines method setFile(String).

@@ -144,7 +144,7 @@ public class VerboseListener mTotalErrors = 0; mWriter.println("Audit started."); } - + public void auditFinished(AuditEvent aEvt) { mWriter.println("Audit finished. Total errors: " + mTotalErrors); @@ -197,10 +197,10 @@ public class VerboseListener }

- A listener that filters error events could perform the filtering in methods - addError and addException. As further examples - of listeners, CommonsLoggingListener - reports its events through the Commons Logging API, and MailLogger + A listener that filters error events could perform the filtering in methods + addError and addException. As further examples + of listeners, CommonsLoggingListener + reports its events through the Commons Logging API, and MailLogger e-mails the audit report of a DefaultLogger.

@@ -209,20 +209,20 @@ public class VerboseListener

To incorporate a custom listener in the set of listeners for a Checker, include a module element for the listener in the - configuration file. For example, to configure a Checker + configuration file. For example, to configure a Checker so that it uses custom listener VerboseListener to print audit messages to a file named "audit.txt", include the following module in the configuration file:

-
     
+      
     <module name="com.mycompany.listeners.VerboseListener">
         <property name="file" value="audit.txt"/>
     </module>
       

- Here is a truncated example of audit output from a + Here is a truncated example of audit output from a VerboseListener:

@@ -240,45 +240,45 @@ public class VerboseListener

Examples

- This section describes two examples based on ANT listeners. The first listener, - CommonsLoggingListener, hands off events to the Jakarata - Commons Logging façade and the second, MailLogger, - sends a report of an audit via e-mail. The discussion of these examples and how - to use them is derived from material in "Java - Development with Ant" by Eric Hatcher and Steve Loughran, an excellent + This section describes two examples based on ANT listeners. The first listener, + CommonsLoggingListener, hands off events to the Jakarata + Commons Logging façade and the second, MailLogger, + sends a report of an audit via e-mail. The discussion of these examples and how + to use them is derived from material in "Java + Development with Ant" by Eric Hatcher and Steve Loughran, an excellent ANT book.

CommonsLoggingListener

- Jakarata Commons + Jakarata Commons Logging provides a façade for logging tools log4j, - Avalon LogKit, - J2SE 1.4, and others. Checkstyle listener - CommonsLoggingListener responds to an AuditEvent by handing it off to the + Avalon LogKit, + J2SE 1.4, and others. Checkstyle listener + CommonsLoggingListener responds to an AuditEvent by handing it off to the current Commons Logging Log.

- The source code for CommonsLoggingListener is in - distribution directory contrib/examples/listeners. - Notice that each AuditListener method that receives an - AuditEvent calls a method for the Commons Logging log level corresponding - to the Checkstyle SeverityLevel of the + The source code for CommonsLoggingListener is in + distribution directory contrib/examples/listeners. + Notice that each AuditListener method that receives an + AuditEvent calls a method for the Commons Logging log level corresponding + to the Checkstyle SeverityLevel of the AuditEvent.

- The easiest way to use CommonsLoggingListener is to - include checkstyle-all-@CHECKSTYLE_VERSION@.jar in - the classpath because that jar file contains all the Commons Logging classes. - The default Log under J2SE 1.4 is wrapper class Jdk14Logger. - Under earlier Java versions, the default Log is a simple wrapper class, SimpleLog. - Both default logging tools can be used directly from Commons Logging; if you - need to use other tools such as log4j, then you must include the appropriate jar + The easiest way to use CommonsLoggingListener is to + include checkstyle-all-@CHECKSTYLE_VERSION@.jar in + the classpath because that jar file contains all the Commons Logging classes. + The default Log under J2SE 1.4 is wrapper class Jdk14Logger. + Under earlier Java versions, the default Log is a simple wrapper class, SimpleLog. + Both default logging tools can be used directly from Commons Logging; if you + need to use other tools such as log4j, then you must include the appropriate jar file(s) in the classpath.

- Logging configuration details for Jakarta Commons Logging are in the documentation. - As a simple example, assume that log4j.jar is in - the classpath and the following log4j.properties + Logging configuration details for Jakarta Commons Logging are in the documentation. + As a simple example, assume that log4j.jar is in + the classpath and the following log4j.properties file is in the current directory:

@@ -293,7 +293,7 @@ public class VerboseListener
       log4j.appender.A1.layout.ConversionPattern=%-5p %c %x- %m%n
     

- Running a Checkstyle audit with a CommonsLoggingListener + Running a Checkstyle audit with a CommonsLoggingListener yields this (abbreviated) output:

@@ -317,13 +317,13 @@ public class VerboseListener
       from environment properties that can be read from a properties file.
       

- The source code for CommonsLoggingListener is in + The source code for CommonsLoggingListener is in distribution directory contrib/examples/listeners. This implementation uses the JavaMail API as the mail system, and you must include appropriate jar files in the classpath.

- As an example of using MailLogger, + As an example of using MailLogger, set system property -DMailLogger.properties.file=MailLogger.properties, so that MailLogger reads message parameters from file MailLogger.properties of the current directory: @@ -336,12 +336,12 @@ public class VerboseListener

Huh? I can't figure it out!

- That's probably our fault, and it means that we have to provide better - documentation. Please do not hesitate to ask questions on the user mailing list, - this will help us to improve this document. Please ask your questions as - precisely as possible. We will not be able to answer questions like "I want - to write a listener but I don't know how, can you help me?". Tell us - what you are trying to do (the purpose of the listener), what you have + That's probably our fault, and it means that we have to provide better + documentation. Please do not hesitate to ask questions on the user mailing list, + this will help us to improve this document. Please ask your questions as + precisely as possible. We will not be able to answer questions like "I want + to write a listener but I don't know how, can you help me?". Tell us + what you are trying to do (the purpose of the listener), what you have understood so far, and what exactly you are getting stuck on.

@@ -349,8 +349,8 @@ public class VerboseListener

We need your help to keep improving Checkstyle. - Whenever you write a listener that you think is generally useful, please - consider contributing it to the Checkstyle + Whenever you write a listener that you think is generally useful, please + consider contributing it to the Checkstyle community and submit it for inclusion in the next release of Checkstyle.

@@ -363,7 +363,7 @@ public class VerboseListener Back to the Checkstyle Home Page