Home | Clover | Clover.NET | FishEye | Support | Account | Download | Buy Now

Source Directives

Clover supports a number of directives that you can use in your source to control instrumentation. Directives can be on a line by themselves or part of any valid single or multi-line java comment.

Switching Clover on and off

    ///CLOVER:ON
    ///CLOVER:OFF

Switch Clover instrumentation on/off. This might be useful if you don't want Clover to instrument a section of code for whatever reason. Note that the scope of this directive is the current file only.

Force Clover to flush

    ///CLOVER:FLUSH

Clover will insert code to flush coverage data to disk. The flush code will be inserted as soon as possible after the directive. See Flush Policies.

Change instrumentation strategy

Warning
This source directive has been deprecated and has no effect in Clover 1.3 and above.
    ///CLOVER:USECLASS

Clover will use a static holder class rather than a static member variable to support instrumentation for the current file. The directive must occur before the first top level class declaration in the file. This directive is useful when you don't want Clover to change the public interface of your class (in EJB compilation for example).