Can I re-use Checkstyle formats?

Viewed 27

Imagine a hypothetical Checkstyle pattern where I want to enforce that all parameters are prefixed with param. Then I would end up with something like this:

<module name="CatchParameterName">
    <property name="format" value="^param[A-Z][a-zA-Z0-9]*$" />
</module>
<module name="LambdaParameterName">
    <property name="format" value="^param[A-Z][a-zA-Z0-9]*$" />
</module>
<module name="ParameterName">
    <property name="format" value="^param[A-Z][a-zA-Z0-9]*$" />
</module>

But, I don't really like re-defining the format for each rule.

Is there a way to define the pattern once and re-use it in all three *ParameterName rules?

0 Answers
Related