Using Configuration Block Checks
Configuration block checks allow you to specify sections of configuration files to perform matches against. A basic ConfigBlockCheck
XML object looks like the following:
<ConfigBlockCheck boundary-method="boundary-method" block-start="regular expression" method-specific attributes>
<statements...>
</ConfigBlockCheck>
A configuration block always starts based upon a regular expression. Examples appear in the following subsections.
Configuration block checks also support four different boundary-method
values, each of which provides a mechanism to determine the end of the block. Some methods are simpler than others and have specific limitations. Two additional options (end-on-block-start
and end-on-eof
) apply to all four methods.
Some additional attributes are used to work with configuration block check routines, including the following:
| Used for regular expression-based configuration block checks; set to true by default; prevents overrunning the intended end of a configuration block. May apply to any of the four boundary methods. |
| Defines the end of a block evaluation to occur at the end of a config file. May apply to any of the four boundary methods. |
| Used with a regular expression, defines the end of a configuration block. Applies to the regexp boundary method. |
| Define characters that will considered indentation characters. Applies to the indent boundary type. |
| The initial delimiter character for the desired configuration block boundary, such as "{". Applies to the balanced-delimiters boundary type. |
| The closing delimiter character for the desired configuration block boundary, such as "}". Applies to the balanced-delimiters boundary type. |
| Define the number of lines in a block of code that comprises the boundary. Applies to the line count boundary type. |
The four boundary-method
types, which are used to determine the boundaries for a configuration block to check against, are described in the following subsections.