# Property Types

- About
- Checkstyle
- Documentation
- Release Notes
- Configuration
- Property Types
- integer
- string
- boolean
- stringSet
- intSet
- regexp
- parenPad
- wrapOp
- block
- lcurly
- rcurly
- scope
- severity
- persistence
- Running
- Ant Task
- Command Line
- Available Checks
- Standard Checks
- Javadoc Comments
- Naming Conventions
- Headers
- Imports
- Size Violations
- Whitespace
- Modifiers
- Block Checks
- Coding
- Class Design
- Duplicate Code
- Metrics
- Miscellaneous
- Optional Checks
- J2EE Checks
- Extending Checkstyle
- Writing checks
- Writing filters
- Writing listeners
- Javadoc
- SourceForge
- Mailing Lists
- Bug Database
- Feature Requests
- Developers
- Project Page
- CVS Repository
- Contributing

- Hosted by:

Checkstyle is configured using properties, which are string 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 true:

- yes
- true
- on

Anything else will map to false.

## stringSet

This property represents a set of strings. The string representation is parsed as a set of comma (',') separated strings.

## intSet

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.

## regexp

This property represents a regular expression. The string representation is parsed using java.util.regex package.

## parenPad

This property represents the policy for padding with white space. The following table describes the valid options:

Option | Definition
nospace | Do not pad. For example, method(a, b);
space | Ensure padding. For example, method( a, b );

## wrapOp

This property represents the policy for wrapping lines on operators. The following table describes the valid options:

Option | Definition
nl | The operator must be on a new line. For example:
        someVariable = aBigVariableNameToMakeThings + "this may work"
                       + lookVeryInteresting;
eol | The operator must be at the end of the line. For example:
        someVariable = aBigVariableNameToMakeThings + "this may work" +
                       lookVeryInteresting;

## block

This property represents the policy for checking block statements. The following table describes the valid options:

Option | Definition
text | Require that there is some text in the block. For example:
        catch (Exception ex) {
            // This is a bad coding practice
        }
stmt | Require that there is a statement in the block. For example:
        finally {
            lock.release();
        }

## lcurly

This property represents the policy for checking the placement of a left curly brace ('{'). The following table describes the valid options:

Option | Definition
eol | The brace must always be on the end of the line. For example:
        if (condition) {
            ...
nl | The brace must always be on a new line. For example:
        if (condition)
        {
            ...
nlow | If the brace will fit on the first line of the statement, taking into account maximum line length, then apply eol rule. Otherwise apply the nl rule. nlow is a mnemonic for "new line on wrap". For the example above Checkstyle will enforce:
        if (condition) {
            ...
But for a statement spanning multiple lines, Checkstyle will enforce:
        if (condition1 && condition2 &&
            condition3 && condition4)
        {
            ...

## rcurly

This property represents the policy for checking the placement of a right curly brace ('}'). The following table describes the valid options:

Option | Definition
same | The brace must be on the same line as the next statement. For example:
        try {
            ...
        } finally {
alone | The brace must be alone on the line. For example:
        try {
            ...
        }
        finally {

## scope

This property represents a Java scope. The scope is treated inclusevly (as javadoc does): 'package' means all 'package', 'protected' and 'public' methods/fields/classes. The valid options are:

- nothing
- public
- protected
- package
- private
- anoninner

## severity

This property represents the severity level of a check violation. The valid options are:

- ignore
- info
- warning
- error

## persistence

This property represents the policy for checking entity beans according to whether the beans have bean-managed persistence, container-managed persistence, or mixed persistence:

Option | Definition
bean | The beans have bean-managed persistence.
container | The beans have container-managed persistence.
mixed | The beans have mixed bean-managed and container-managed persistence.

Copyright © 2001-2005, Oliver Burn