From c6d2120f6ecccedf19fca9979d44e086d8d395e2 Mon Sep 17 00:00:00 2001 From: Oliver Burn Date: Wed, 4 Sep 2002 08:03:05 +0000 Subject: [PATCH] Against a snap shot of changes I do not want to lose. --- docs/checks_header.html | 30 ++++++++------ docs/checks_javadoc.html | 61 ++++++++++++++++++++------- docs/checks_misc.html | 19 +++++---- docs/checks_patterns.html | 87 +++++++++++++++++++++++++-------------- docs/property_types.html | 35 ++++++++++++++-- 5 files changed, 161 insertions(+), 71 deletions(-) diff --git a/docs/checks_header.html b/docs/checks_header.html index 8c54f3dc6..1930e73d4 100644 --- a/docs/checks_header.html +++ b/docs/checks_header.html @@ -9,17 +9,19 @@

Checks for Headers

The property checkstyle.header.file controls -whether Checkstyle checks that each files with a specified header. The header +whether to check that each file begins with a specified header. The header contents are specified in the file. If no file is specified, checkstyle does -not check for a header. The property type is java.lang.String and defaults to null (which means do not check).

+not check for a header. The property type is +string and defaults to +null (which means do not check).

-

The property checkstyle.header.ignoreline can be -used to tell Checkstyle to ignore matching lines in a header file. The -property type is a list of comma separated integers and defaults to an empty -list. This property is very useful for supporting headers that contain -copyright dates. For example, consider the following header:

+

The property checkstyle.header.ignoreline +specifies the line numbers to ignore when matching lines in a header file. The +property type is integer set and +defaults to an empty list.

+ +

This property is very useful for supporting headers that contain copyright +dates. For example, consider the following header:

 line 1: ///////////////////////////////////////////////////////////////////////
@@ -32,10 +34,12 @@ line 4: ///////////////////////////////////////////////////////////////////////
 to ignore line 3 by setting the property to 3.

The property checkstyle.header.regexp controls -whether Checkstyle will interpret each header line as a regular -expression. The property type is boolean and defaults to false. For example, consider the following header when -regular expression checking is turned on:

+whether to interpret each header line as a regular expression. The property +type is boolean and defaults to +false.

+ +

For example, consider the following header when regular expression checking +is turned on:

 line 1: /{71}
diff --git a/docs/checks_javadoc.html b/docs/checks_javadoc.html
index c8ba4757f..8e0e7d244 100644
--- a/docs/checks_javadoc.html
+++ b/docs/checks_javadoc.html
@@ -16,27 +16,40 @@
   
  • method
  • -

    The property checkstyle.javadoc.scope controls the visibility scope where Javadoc comments are checked. For example, you can check Javadoc code only for public and protected variables, methods, interfaces and class definitions. Scoping rules apply, in the above example a public method in a package visible class is not checked.

    +

    The property checkstyle.javadoc.scope controls +the visibility scope where Javadoc comments are checked. The property type is +scope and defaults to +private.

    + +

    For example, you can check Javadoc comments only for public and protected definitions +by setting the property to protected. Scoping +rules apply, so a public method in a package visible +class is not checked.

    -

    Valid values for checkstyle.javadoc.scope are:

    -
      -
    • "nothing" -
    • "public" -
    • "protected" -
    • "package" -
    • "private" (default value) -
    • "anoninner" -

    package.html check

    -

    The property checkstyle.require.packagehtml controls whether to require that a package.html file exists for each package. The property type is boolean and defaults to false.

    + +

    The property checkstyle.require.packagehtml +controls whether to require that a package.html file +exists for each package. The property type is +boolean and defaults to +false.

    Class/Interface Javadoc checks

    -

    The property checkstyle.require.version controls whether to require an @version tag to be defined for class and interface Javadoc comments. The property is boolean and defaults to "false".

    +

    The property checkstyle.require.version controls +whether to require an @version tag to be defined +for class and interface Javadoc comments. The property type is +boolean and defaults to +false.

    -

    The property checkstyle.allow.noauthor controls whether to allow no @author tag to be defined for class and interface Javadoc comments. The property is boolean and defaults to "false".

    +

    The property checkstyle.allow.noauthor controls +whether to allow no @author tag to be defined for +class and interface Javadoc comments. The property type is +boolean and defaults to +false.


    Method Javadoc checks

    @@ -63,11 +76,29 @@ int aLineNo)
    -

    By default an unused @throws tag is reported as error. The property checkstyle.javadoc.checkUnusedThrows controls checking to determine if the exception is a subclass of java.lang.RuntimeException. This supports the convention in the Sun Javadoc Guidelines and the "Effective Java" book. The property is boolean and defaults to false. The classpath may need to be configured to locate the class information..

    +

    The property checkstyle.javadoc.checkUnusedThrows +controls whether to check if an undocumented exception is a subclass of +java.lang.RuntimeException. The property type is +boolean and defaults to +false.

    + +

    This supports the convention in +the Sun Javadoc Guidelines +and the "Effective Java" book.

    + +

    The classpath may need to be configured to locate the class +information. The classpath configuration is dependent on the mechanism used to +invoke Checkstyle.

    Tip

    -

    It can be extremely painful writing or duplicating Javadoc for a method required for an interface. Hence checkstyle supports using the convention of using a single @see tag instead of all the other tags. For example, if the previous method was implementing a method required by the com.puppycrawl.tools.checkstyle.Verifier interface, then the Javadoc could be done as:

    + +

    It can be extremely painful writing or duplicating Javadoc for a method +required for an interface. Hence checkstyle supports using the convention of +using a single @see tag instead of all the other +tags. For example, if the previous method was implementing a method required +by the com.puppycrawl.tools.checkstyle.Verifier +interface, then the Javadoc could be done as:

         /** @see com.puppycrawl.tools.checkstyle.Verifier **/
    diff --git a/docs/checks_misc.html b/docs/checks_misc.html
    index c462bb75e..7cf00ee4e 100644
    --- a/docs/checks_misc.html
    +++ b/docs/checks_misc.html
    @@ -11,20 +11,21 @@
     

    To-do comments

    The property checkstyle.pattern.todo specifies -the pattern to match for to-do comments. The property type is regular -expression and defaults to "TODO:".

    +the pattern to match for to-do comments. The property type is +regular expression and defaults to +TODO:.

    Integer Literals

    The property checkstyle.ignore.longell specifies -whether Checkstyle verifies that long integer literals use an uppercase L. For example 40L instead of -40l. This is in accordance to the Java Language -Specification, Section -3.10.1. The property type is boolean and defaults to false.

    +whether to not require that long integer literals use an uppercase +L. For example 40L instead +of 40l. This is in accordance to the Java Language +Specification, +Section 3.10.1. +The property type is boolean and +defaults to false.

  • checkstyle.illegal.instantiations"
  • diff --git a/docs/checks_patterns.html b/docs/checks_patterns.html index a56981492..5117edc2e 100644 --- a/docs/checks_patterns.html +++ b/docs/checks_patterns.html @@ -13,76 +13,100 @@ specified naming conventions which are specifed as regular expressions. The excellent Jakarta Regexp library is used by Checkstyle.

    -

    Format of variable names

    +

    Format of members

    The property checkstyle.pattern.member specifies -the format for members (non static). Defaults to -^[a-z][a-zA-Z0-9]*$. An example is:

    +the format for members (non static). +The property type is +regular expression and defaults to +^[a-z][a-zA-Z0-9]*$.

    + +

    An example is:

         private int mySize = 0;
     
    +

    The property checkstyle.pattern.publicmember +specifies the format for public members (non +static public). The property type is +regular expression and defaults to +^f[A-Z][a-zA-Z0-9]*$.

    + +
    +

    Tip

    + +

    This is useful for the fields required for Container Managed Persistence +(CMP) Enterprise JavaBeans 1.1. An example is:

    + +
    +    public int fCMPField;
    +
    +
    + + +

    Format of constants

    The property checkstyle.pattern.const specifies -the format for constants (static and final). Defaults to ^[A-Z](_?[A-Z0-9]+)*$. The exception to the rule is for -serialVersionUID. An example is:

    +the format for constants (static and +final). The property type is +regular expression and defaults to +^[A-Z](_?[A-Z0-9]+)*$.

    + +

    The exception to the rule is serialVersionUID. An +example is:

         public static final int MAX_ROWS = 2;
     
    +

    Format of statics

    +

    The property checkstyle.pattern.static specifies -the format for static variables (static -only). Defaults to ^[a-z][a-zA-Z0-9]*$. An example -is:

    +the format for static variables (static only). +The property type is +regular expression and defaults to +^[a-z][a-zA-Z0-9]*$.

    + +

    An example is:

         private static int numCreated = 0;
     
    -

    The property checkstyle.pattern.publicmember -specifies the format for public members (non static public). Defaults to ^f[A-Z][a-zA-Z0-9]*$. This is useful for the fields -required for Container Managed Persistence (CMP) Enterprise JavaBeans 1.1. An -example is:

    - -
    -    public int fCMPField;
    -
    -

    Format of parameter names

    The property checkstyle.pattern.parameter -specifies the format for parameter names. The default is ^[a-z][a-zA-Z0-9]*$.

    +specifies the format for parameter names. The property type is +regular expression and defaults to +^[a-z][a-zA-Z0-9]*$.

    Format of type names

    The property checkstyle.pattern.type specifies -the format for class and interface names. The default is ^[A-Z][a-zA-Z0-9]*$.

    +the format for class and interface names. The property type is +regular expression and defaults to +^[A-Z][a-zA-Z0-9]*$.

    Format of method names

    The property checkstyle.pattern.method specifies -the format for method names. The default is ^[a-z][a-zA-Z0-9]*$.

    +the format for method names. The property type is +regular expression and defaults to +^[a-z][a-zA-Z0-9]*$.

    Format of local variable names

    The property checkstyle.pattern.localvar -specifies the format for local variables. The default is ^[a-z][a-zA-Z0-9]*$. An example is:

    +specifies the format for local variables. The property type is +regular expression and defaults to +^[a-z][a-zA-Z0-9]*$.

         int localInt = 3;
    @@ -90,8 +114,9 @@ class="code">^[a-z][a-zA-Z0-9]*$. An example is:

    The property checkstyle.pattern.localfinalvar -specifies the format for final local variables. The default is ^[a-z][a-zA-Z0-9]*$. An example is:

    +specifies the format for final local variables. The property type is +regular expression and defaults to +^[a-z][a-zA-Z0-9]*$.

         final int finalLocalInt = 3;
    diff --git a/docs/property_types.html b/docs/property_types.html
    index 072c1ce35..c61bf86b7 100644
    --- a/docs/property_types.html
    +++ b/docs/property_types.html
    @@ -12,6 +12,18 @@
     representations. This document describes how these string representations are
     mapped to typed properties.

    +

    Integer

    + +

    This property represents an integer. The string representation is parsed +using the java.lang.Integer class.

    + + +

    String

    + +

    This property represents a string. The literal string representation is +used.

    + +

    Boolean

    This property represents a boolean. The default value is false. The following string representations will map to parsed as a set of comma (',') separated strings.

    -

    Integer

    +

    Integer Set

    -

    This property represents an integer. The string representation is parsed -using the java.lang.Integer class.

    +

    This property represents a set of integers. The string representation is +parsed as a set of comma (',') separated integers that are parsed using the +java.lang.Integer class.

    Regular Expression

    @@ -96,5 +109,21 @@ following table describes the valid options:

    + +

    Scope

    + +

    This property represents a Java scope. The valid options are:

    + +
      +
    • nothing +
    • public +
    • protected +
    • package +
    • private +
    • anoninner +
    + + +